在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
}
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
}
相关文章推荐
- 使用XML作为项目的配置文件使用,并解析之,获得数据作为链接数据库的参数
- web 项目中 在spring中使用log4j 定时刷新log4j配置文件
- 【黑马训练营】在项目中使用配置文件
- 使用ant进行项目打包的配置文件
- 使用ant及IDE配置文件进行Android项目初步的标准化,规范化构建
- 使用XML作为项目的配置文件使用,并解析之,获得数据作为链接数据库的参数
- Asp.net中Web项目使用EnterpriseLibrary5.0独立配置文件找不到问题
- ThinkPHP多应用/项目配置技巧(使用同一配置文件)--(十六)
- 报表文件在项目使用时tomact里的配置
- Java项目中使用配置文件配置
- MyEclipse中为struts项目添加和使用多个Struts-Config配置文件
- 大型Java项目中使用maven进行管理,pom.xml文件中build的配置
- 01.Django学习之安装,建立项目,传参,MySQL数据库,静态文件配置和模板的使用
- Apache 项目 之 commons-configuration-1.10.jar 使用 properties配置文件时的编码设置
- Ant的项目配置文件build.xml(使用jboss-4.2.3GA-jdk6.zip)
- 获取java web项目里面所有的properties文件并组装在一起,使用方便,配置简单
- 使用注解,实现ssh项目中spring配置文件的零配置,约定优于配置
- ThinkPHP多应用/项目配置技巧(使用同一配置文件)--(十六)
- 在java程序项目中如何使用xml配置文件存储信息简述
- ThinkPHP第七天(F函数使用,项目分组配置,项目分组模板文件放置规则配置)