webpack 輸出多個文件

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

webpack 文章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。web

相關文章
相關標籤/搜索