Files
keras-js/demos/webpack.prod.config.js
2016-10-06 17:12:11 -04:00

50 lines
1000 B
JavaScript

const path = require('path')
const webpack = require('webpack')
const precss = require('precss')
const autoprefixer = require('autoprefixer')
module.exports = {
entry: [
path.join(__dirname, 'src/index')
],
output: {
path: path.join(__dirname, 'dist'),
filename: 'bundle.js'
},
module: {
loaders: [
{
test: /\.js$/,
loaders: ['babel-loader'],
exclude: /node_modules/
},
{
test: /\.css$/,
loader: 'style-loader!css-loader!postcss-loader'
}
]
},
resolve: {
extensions: ['.js']
},
plugins: [
new webpack.LoaderOptionsPlugin({
options: {
context: __dirname,
postcss: [precss, autoprefixer]
}
}),
new webpack.DefinePlugin({
'process.env': {
'NODE_ENV': JSON.stringify('production')
}
}),
new webpack.optimize.DedupePlugin(),
new webpack.optimize.UglifyJsPlugin({
compress: {
warnings: false
}
})
]
}