Skip to content

Commit

Permalink
chore: add kitchen-sync
Browse files Browse the repository at this point in the history
  • Loading branch information
Pooya Parsa committed Mar 28, 2018
1 parent 999023e commit 63f1adb
Show file tree
Hide file tree
Showing 6 changed files with 46 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ Thumbs.db
.vscode
*.sublime-project
*.sublime-workspace
test/**/dist
dist
4 changes: 4 additions & 0 deletions kitchen-sync/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/* eslint-disable */

import 'chalk';
import 'eslint';
5 changes: 5 additions & 0 deletions kitchen-sync/test-loader.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
function loader(source) {
return `/* Length: ${source.length} */\n ${source}`;
}

module.exports = loader;
29 changes: 29 additions & 0 deletions kitchen-sync/webpack.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
const path = require('path');
const requireESM = require('esm')(module);

const Self = requireESM('../src/index').default;

module.exports = {
mode: 'production',
context: __dirname,
devtool: false,
target: 'node',
entry: './index.js',
stats: false,
output: {
filename: './output.js',
path: path.join(__dirname, '/dist'),
},
module: {
rules: [{ test: /\.js$/, use: path.resolve(__dirname, 'test-loader.js') }],
},
plugins: [
new Self({
color: 'yellow',
showCursor: true,
profile: true,
clear: false,
name: 'webpack-bar',
}),
],
};
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@
"ci:lint": "npm run lint && npm run security",
"ci:test": "npm run test -- --runInBand",
"ci:coverage": "npm run test:coverage -- --runInBand",
"defaults": "webpack-defaults"
"defaults": "webpack-defaults",
"kitchen-sync": "webpack-cli --config kitchen-sync/webpack.config.js"
},
"dependencies": {
"chalk": "^2.3.2",
Expand Down Expand Up @@ -60,6 +61,7 @@
"eslint-config-webpack": "^1.2.5",
"eslint-plugin-import": "^2.9.0",
"eslint-plugin-prettier": "^2.6.0",
"esm": "^3.0.11",
"husky": "^0.14.3",
"jest": "^22.4.3",
"lint-staged": "^7.0.0",
Expand Down
4 changes: 4 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2580,6 +2580,10 @@ eslint@^4.19.1:
table "4.0.2"
text-table "~0.2.0"

esm@^3.0.11:
version "3.0.11"
resolved "https://registry.yarnpkg.com/esm/-/esm-3.0.11.tgz#223baf6b5ab6956efbec6e554e8af1824145d160"

espree@^3.5.4:
version "3.5.4"
resolved "https://registry.yarnpkg.com/espree/-/espree-3.5.4.tgz#b0f447187c8a8bed944b815a660bddf5deb5d1a7"
Expand Down

0 comments on commit 63f1adb

Please sign in to comment.