您的位置:首页 > Web前端 > Webpack

在roathog配置的项目中使用webpack配置文件

2018-01-07 16:33 483 查看
roathog配置的react文件能大大简化我们的配置难度,但是有时候我们又必须使用webpack的强大的功能,这时我们就需要写webpack.config.js,配置如下:

const webpack = require('webpack')
const QiniuPlugin = require('qiniu-webpack-plugin')
const config = require('./secret')
module.exports = function (webpackConfig, env) {
if (env !== 'production') {} else {
webpackConfig.plugins.push(
new webpack.optimize.UglifyJsPlugin({
compress: {
warnings: false,
drop_debugger: true,
drop_console: true
}
}),
new QiniuPlugin({
ACCESS_KEY: config.ACCESS_KEY,
SECRET_KEY: config.SECRET_KEY,
bucket: 'test',
path: 'fe/'
})
)
}
return webpackConfig
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐