awv3
Version:
⚡ AWV3 embedded CAD
59 lines (57 loc) • 1.81 kB
JavaScript
const path = require('path');
const webpack = require('webpack');
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin;
module.exports = env => ({
entry: './browser.js',
output: {
path: path.resolve('./dist'),
filename: 'browser.js'
},
module: {
loaders: [
{
test: /\.js$/,
loaders: [
'babel-loader?' +
JSON.stringify({
babelrc: false,
cacheDirectory: true,
presets: [['es2015', { loose: true }], 'stage-0'],
plugins: ['transform-runtime']
})
]
},
{ test: /\.glsl$/, loader: 'webpack-glsl-loader' }
]
},
resolve: {
modules: [path.resolve('./'), 'node_modules'],
extensions: ['.js', '.jsx'],
},
externals: {
three: 'THREE',
jquery: '$',
'ms-signalr-client': '$.signalR',
'socket.io-client': 'socket.io-client'
},
plugins: [
new webpack.DefinePlugin({ 'process.env': { NODE_ENV: JSON.stringify('production') } }),
new webpack.optimize.ModuleConcatenationPlugin(),
new webpack.LoaderOptionsPlugin({
minimize: true,
debug: false
}),
new webpack.optimize.UglifyJsPlugin({
compress: {
warnings: false,
screw_ie8: true,
drop_console: true,
drop_debugger: true,
dead_code: true,
global_defs: { __REACT_HOT_LOADER__: undefined }
},
mangle: true
}),
//new BundleAnalyzerPlugin()
]
});