1 Star 1 Fork 0

sandii chen / gitnote

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
webpack.config.js 958 Bytes
一键复制 编辑 原始数据 按行查看 历史
sandii chen 提交于 2017-02-22 17:10 . update
const fs = require('fs');
const path = require('path');
const webpack = require('webpack');
const DEBUG = process.env.NODE_ENV === 'DEBUG';
console.log( process.env.NODE_ENV || 'BUILDING BEGINS');
const devHost = 'localhost';
const devPort = 3000;
const serverEntry = DEBUG ? [
`webpack-dev-server/client?http://${devHost}:${devPort}`,
'webpack/hot/only-dev-server'
] : [];
const config = {
entry : [path.join(__dirname, './public/js/main.js')],
output : {
path : path.join(__dirname, './public/js/'),
filename : '[name]-min.js',
publicPath : '/public/js/'
},
module: {
loaders: [
{
test: /\.js$/,
exclude: /node_modules/,
loader: 'babel-loader',
query: {
presets: ['react','es2015']
}
}
]
},
plugins: [
(DEBUG
? new webpack.HotModuleReplacementPlugin()
: new webpack.optimize.UglifyJsPlugin()
),
new webpack.NoErrorsPlugin()
],
devHost,
devPort
};
module.exports = config;
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
JavaScript
1
https://gitee.com/sandii/gitnote.git
git@gitee.com:sandii/gitnote.git
sandii
gitnote
gitnote
master

搜索帮助

344bd9b3 5694891 D2dac590 5694891