webpack 输出多个文件

http://react-china.org/t/webpack/1870/2

webpack 文章

entry = {
    "button": "demo/button/index.jsx"),
    "grid": "demo/grid/index.jsx")
},
output: {
    path:  'dist/js',
    filename: "[name].js",
    chunkFilename: "[name].js"
},
plugins: [
    new CommonsChunkPlugin("common.js", ["button", "grid"])
]

output中的[name]对应于entry中的key值,因此生成后的文件名是button.js和grid.js。

posted @ 2016-09-09 11:33  miyaye  阅读(1839)  评论(0编辑  收藏  举报