用webpack的UglifyJsPlugin怎樣壓縮一個全是函數(shù)的js文件
1 回答

泛舟湖上清波郎朗
TA貢獻1818條經(jīng)驗 獲得超3個贊
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
})
]
}
- 1 回答
- 0 關(guān)注
- 1173 瀏覽
添加回答
舉報
0/150
提交
取消