2018-05-30 08:23:57 -07:00
|
|
|
// Copyright (c) 2015-2016 Yuya Ochiai
|
|
|
|
// Copyright (c) 2016-present Mattermost, Inc. All Rights Reserved.
|
|
|
|
// See LICENSE.txt for license information.
|
|
|
|
|
2018-04-10 05:13:34 -07:00
|
|
|
/* eslint-disable import/no-commonjs */
|
2016-10-12 08:08:04 -07:00
|
|
|
'use strict';
|
|
|
|
|
2018-05-25 07:12:52 -07:00
|
|
|
const webpack = require('webpack');
|
|
|
|
|
2016-10-12 08:08:04 -07:00
|
|
|
const isProduction = process.env.NODE_ENV === 'production';
|
|
|
|
|
|
|
|
module.exports = {
|
2018-05-25 07:12:52 -07:00
|
|
|
|
|
|
|
// 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')}),
|
|
|
|
] : [],
|
2018-02-21 11:20:33 -08:00
|
|
|
devtool: isProduction ? false : '#inline-source-map',
|
2016-10-12 08:08:04 -07:00
|
|
|
};
|