whs.js/webpack.config.babel.js
sasha240100 42abd98748 WIP.
Former-commit-id: 374cd293b1e17ccbea65330747e4eb028e289152
2016-06-08 16:57:19 +03:00

45 lines
882 B
JavaScript

import {join} from 'path';
import webpack from 'webpack';
process.env.BABEL_ENV = 'browser';
function config({production}) {
return {
devtool: production ? 'hidden-source-map' : 'eval-source-map',
entry: './src/index.js',
output: {
path: join(__dirname, 'build'),
filename: 'whitestorm.js',
library: 'WHS',
libraryTarget: 'var'
},
module: {
loaders: [
{
test: /\.js$/,
exclude: /node_modules/,
loader: 'babel'
}
]
},
plugins: production
? [
new webpack.optimize.DedupePlugin(),
new webpack.optimize.UglifyJsPlugin({
mangle: false,
compress: {
warnings: false
}
}),
new webpack.ProvidePlugin({
THREE: 'three'
})
]
: []
};
}
export {
config as default
};