feat(build): Add source maps to production
We don't have the same precautions as other sites as our code base is open source, so we might as well make it easier on us to debug production errors
This commit is contained in:
@@ -1,11 +1,12 @@
|
||||
const webpack = require('webpack');
|
||||
const path = require('path');
|
||||
const UglifyPlugin = require('uglifyjs-webpack-plugin');
|
||||
|
||||
const __DEV__ = process.env.NODE_ENV !== 'production';
|
||||
|
||||
module.exports = {
|
||||
entry: './client/frame-runner.js',
|
||||
devtool: __DEV__ ? 'inline-source-map' : null,
|
||||
devtool: __DEV__ ? 'inline-source-map' : 'source-map',
|
||||
node: {
|
||||
// Mock Node.js modules that Babel require()s but that we don't
|
||||
// particularly care about.
|
||||
@@ -68,4 +69,12 @@ if (__DEV__) {
|
||||
// prevents build on error
|
||||
new webpack.NoEmitOnErrorsPlugin()
|
||||
);
|
||||
} else {
|
||||
module.exports.plugins.push(
|
||||
new UglifyPlugin({
|
||||
test: /\.js($|\?)/i,
|
||||
cache: true,
|
||||
sourceMap: true
|
||||
})
|
||||
);
|
||||
}
|
||||
|
Reference in New Issue
Block a user