Skip to content

Instantly share code, notes, and snippets.

@umezo
Last active July 22, 2016 07:54
Show Gist options
  • Save umezo/df567f28a8c6b974cb0fc29629aa0214 to your computer and use it in GitHub Desktop.
Save umezo/df567f28a8c6b974cb0fc29629aa0214 to your computer and use it in GitHub Desktop.
comprehension check for how work substitutions [hash] and [chunkhash]
node_modules/
dest/

[hash]と[chunkhash]がどのような値か確認する

module.exports = "A";
module.exports = "B";
console.log("- entryA.js -------------------");
console.log(require("./a"));
console.log("hoge");
console.log("- entryB.js -------------------");
console.log(require("./b"));
module.exports = {id:"entryB.js"};
{
"name": "compcheck-substitutions",
"version": "1.0.0",
"description": "[hash]と[chunkhash]がどのような値か確認する",
"main": "index.js",
"scripts": {
"build": "webpack",
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
"url": "git+ssh://git@gist.github.com/df567f28a8c6b974cb0fc29629aa0214.git"
},
"author": "",
"license": "ISC",
"bugs": {
"url": "https://gist.github.com/df567f28a8c6b974cb0fc29629aa0214"
},
"homepage": "https://gist.github.com/df567f28a8c6b974cb0fc29629aa0214",
"devDependencies": {
"webpack": "^1.13.1"
}
}
console.log("- start test.js ----------------");
console.log(require("./dest/bundle.js"));
console.log("- end test.js ----------------");
module.exports = {
entry:{
A:"./entryA.js",
B:"./entryB.js"
},
output: {
filename:"bundle-[name]-[hash].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