Skip to content

Instantly share code, notes, and snippets.

@umezo
Last active July 22, 2016 07:26
Show Gist options
  • Save umezo/e7d2cc8445e00af0172d4e15ce519d73 to your computer and use it in GitHub Desktop.
Save umezo/e7d2cc8445e00af0172d4e15ce519d73 to your computer and use it in GitHub Desktop.
comprehension check how work entry config specified with Array
node_modules/
dest/

webpackのentry設定を配列で定義したらいったいどうなるのか?

  • npm install
  • npm run build
module.exports = "A";
module.exports = "B";
console.log("- entryA.js -------------------");
console.log(require("./a"));
console.log(require("./b"));
console.log("- entryB.js -------------------");
console.log(require("./a"));
console.log(require("./b"));
module.exports = {id:"entryB.js"};
{
"name": "compcheck-entry-array",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"build": "webpack",
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC",
"devDependencies": {
"webpack": "^1.13.1"
}
}
console.log("- start test.js ----------------");
console.log(require("./dest/bundle.js"));
console.log("- end test.js ----------------");
module.exports = {
entry:["./entryA.js","./entryB.js"],
output: {
filename:"bundle.js",
path: __dirname + '/dest',
pathinfo:true,
libraryTarget:"commonjs2"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment