= require('./webpack.config.js');
var BUILD_DIR = path.resolve(__dirname, './public');
var config = {
entry: './index.js',
output: {
path: BUILD_DIR,
filename: 'bundle.js'
},
module: {
loaders: [
{
test: /\.js$/,
exclude: /node_modules/,
loader: 'babel-loader'
},
{
test: /\.css$/,
loader: 'style-loader!css-loader?modules'
},
{
test: /\.(jpg|png|svg)$/,
loader: "file-loader"
}
]
},
plugins: [
new HtmlWebpackPlugin({
template: __dirname + "/index.html"
}),
new webpack.DefinePlugin({
'process.env': {
'NODE_ENV': JSON.stringify('production')
}
})
],
};
module.exports = merge(common, {
plugins: [
new UglifyJSPlugin()
]
});
попробуй webpack --config ./webpack.production.config.js -p
Обсуждают сегодня