3 回答

TA貢獻(xiàn)1808條經(jīng)驗(yàn) 獲得超4個(gè)贊
可以通過(guò)
plugins: [
new CommonsChunkPlugin({
name: '[id].js',
chunks: chunks,
minChunks: 1
})
]
類(lèi)似設(shè)置實(shí)現(xiàn),
普通js文件:
module.exports = {
entry: {
bundle1: './addr.js',
bundle2: './backward.js'
.......
},
output: {
filename: '[name].js'
}
};

TA貢獻(xiàn)1786條經(jīng)驗(yàn) 獲得超11個(gè)贊
webpack配置:
const ExtractTextPlugin = require('extract-text-webpack-plugin')
module.exports = {
output: {
path: path.join(__dirname, './dist'),
filename: 'js/[name].js',
publicPath: '/dist/'
},
module: {
loaders: [
{
test: /\.css$/,
loader: ExtractTextPlugin.extract({
fallbackLoader: 'style',
loader: 'css',
publicPath: '../'
})
},
]
},
plugins: [
new ExtractTextPlugin({
filename: 'css/[name].css',
disable: false,
allChunks: false
})
]
}
- 3 回答
- 0 關(guān)注
- 683 瀏覽
添加回答
舉報(bào)