2018-01-22 23:38:06 +00:00
|
|
|
'use strict';
|
|
|
|
const webpack = require('webpack');
|
|
|
|
const path = require('path');
|
|
|
|
const ClearDistPlugin = require('./plugins/clearDist');
|
|
|
|
const DelayPlugin = require('./plugins/delay');
|
|
|
|
const makeConfig = require('./makeConfig');
|
|
|
|
const electronConfig = require('./webpack.electron-dev.js');
|
|
|
|
|
|
|
|
const jsConfig = makeConfig({
|
|
|
|
isProduction: true,
|
|
|
|
isElectronBuild: true,
|
|
|
|
outputDir: 'electron-js'
|
|
|
|
});
|
|
|
|
|
|
|
|
// Redefine plugins with prod specific stuff
|
2018-04-05 20:53:36 +00:00
|
|
|
electronConfig.mode = 'production';
|
|
|
|
|
2018-01-22 23:38:06 +00:00
|
|
|
electronConfig.plugins = [
|
|
|
|
new ClearDistPlugin(),
|
|
|
|
new webpack.DefinePlugin({
|
|
|
|
'process.env.NODE_ENV': JSON.stringify('production')
|
|
|
|
}),
|
|
|
|
new DelayPlugin(500)
|
|
|
|
];
|
|
|
|
|
2018-06-25 19:27:27 +00:00
|
|
|
// Many native node modules don't like being uglified since they often aren't
|
|
|
|
// for most use cases, and this way logging is a lot easier too.
|
2018-06-15 23:25:29 +00:00
|
|
|
electronConfig.devtool = undefined;
|
2018-06-25 19:27:27 +00:00
|
|
|
electronConfig.optimization = {
|
|
|
|
minimize: false
|
|
|
|
};
|
2018-06-15 23:25:29 +00:00
|
|
|
|
2018-01-22 23:38:06 +00:00
|
|
|
module.exports = [electronConfig, jsConfig];
|