Migrate to webpack 4

This commit is contained in:
Yuya Ochiai
2018-05-25 23:12:52 +09:00
parent 74b49e7d2d
commit 4f308f7d40
4 changed files with 1082 additions and 74 deletions

View File

@@ -1,8 +1,17 @@
/* eslint-disable import/no-commonjs */
'use strict';
const webpack = require('webpack');
const isProduction = process.env.NODE_ENV === 'production';
module.exports = {
// Some plugins cause errors on the app, so use few plugins.
// https://webpack.js.org/concepts/mode/#mode-production
mode: isProduction ? 'none' : 'development',
plugins: isProduction ? [
new webpack.DefinePlugin({'process.env.NODE_ENV': JSON.stringify('production')}),
] : [],
devtool: isProduction ? false : '#inline-source-map',
};