1 Star 0 Fork 0

唇角轻扬/react-webpack-boilerplate

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
webpack.config.js 1.10 KB
一键复制 编辑 原始数据 按行查看 历史
唇角轻扬 提交于 2015-10-25 19:04 . add OccurenceOrderPlugin
var webpack = require('webpack');
var Clean = require('clean-webpack-plugin');
var CommonsChunkPlugin = webpack.optimize.CommonsChunkPlugin;
var isProduction = process.env.NODE_ENV === 'production'
function getEntrySources(sources) {
if (!isProduction) {
sources.unshift('webpack/hot/only-dev-server');
sources.unshift('webpack-dev-server/client?http://localhost:8080');
}
return sources;
}
var jsLoaders = ['babel'];
if (!isProduction) {
jsLoaders.unshift('react-hot');
}
module.exports = {
entry: {
main: getEntrySources([
'./js/main'
]),
vendor: ['react']
},
output: {
path: './dest/',
filename: '[name].js',
chunkFilename: "[id].js",
publicPath: '/dest/',
jsonpFunction: '__wpj_'
},
module: {
loaders: [{
test: /\.js[x]?$/,
exclude: /node_modules/,
loaders: jsLoaders
}]
},
plugins: [
new Clean(['dest']),
new webpack.optimize.OccurenceOrderPlugin(),
new CommonsChunkPlugin('vendor', 'vendor.js')
]
};
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
JavaScript
1
https://gitee.com/chshouyu/react-webpack-boilerplate.git
[email protected]:chshouyu/react-webpack-boilerplate.git
chshouyu
react-webpack-boilerplate
react-webpack-boilerplate
master

搜索帮助