1 Star 0 Fork 0

zhoutk / reactodo

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
web.prod.config.js 1.17 KB
一键复制 编辑 原始数据 按行查看 历史
zhoutk 提交于 2017-05-23 12:35 . webpack.
const path = require('path');
const webpack = require('webpack');
module.exports = {
entry: [
path.join(__dirname, '../../app/web/index'),
],
output: {
path: path.join(__dirname, '../public/'),
filename: 'bundle.js',
publicPath: '/',
},
module: {
loaders: [
// take all less files, compile them, and bundle them in with our js bundle
{
test: /\.less$/,
loader: 'style!css!autoprefixer?browsers=last 2 version!less'
},{
test: /\.json$/,
loader: "json",
},{
test: /\.js$/,
exclude: /node_modules/,
loader: 'babel-loader',
query: {
presets: ['es2015', 'react'],
},
},
],
},
plugins: [
new webpack.DefinePlugin({
'process.env': {
// Useful to reduce the size of client-side libraries, e.g. react
NODE_ENV: JSON.stringify('production'),
PLATFORM_ENV: JSON.stringify('web'),
},
}),
// optimizations
new webpack.optimize.DedupePlugin(),
new webpack.optimize.OccurenceOrderPlugin(),
new webpack.optimize.UglifyJsPlugin({
compress: {
warnings: false,
},
}),
],
};
NodeJS
1
https://gitee.com/zhoutk/reactodo.git
git@gitee.com:zhoutk/reactodo.git
zhoutk
reactodo
reactodo
master

搜索帮助