webpackのentry設定を配列で定義したらいったいどうなるのか?
npm install
npm run build
node_modules/ | |
dest/ |
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" | |
} | |
} | |