UNPKG

awv3

Version:
58 lines (56 loc) 1.75 kB
const path = require('path'); const webpack = require('webpack'); module.exports = env => ({ entry: './src/browser.js', output: { path: __dirname + '/build', 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'] }) ], exclude: /(node_modules)/ }, { test: /\.glsl$/, loader: 'webpack-glsl-loader' } ] }, resolve: { modules: [path.resolve('./src'), '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.LoaderOptionsPlugin({ options: { worker: { output: { filename: 'worker.js' } } }, 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 }) ] });