2018-01-22 23:38:06 +00:00
|
|
|
'use strict';
|
|
|
|
const webpack = require('webpack');
|
|
|
|
const path = require('path');
|
|
|
|
const ClearDistPlugin = require('./plugins/clearDist');
|
|
|
|
const config = require('./config');
|
|
|
|
const makeConfig = require('./makeConfig');
|
|
|
|
|
|
|
|
const electronConfig = {
|
|
|
|
target: 'electron-main',
|
2018-04-05 20:53:36 +00:00
|
|
|
mode: 'development',
|
2018-01-22 23:38:06 +00:00
|
|
|
entry: {
|
2018-01-26 19:53:51 +00:00
|
|
|
main: path.join(config.path.electron, 'main/index.ts')
|
2018-01-22 23:38:06 +00:00
|
|
|
},
|
|
|
|
module: {
|
|
|
|
rules: [config.typescriptRule]
|
|
|
|
},
|
|
|
|
resolve: {
|
|
|
|
extensions: ['.ts', '.js', '.json']
|
|
|
|
},
|
|
|
|
output: {
|
|
|
|
filename: '[name].js',
|
|
|
|
path: path.resolve(config.path.output, 'electron-js')
|
|
|
|
},
|
|
|
|
plugins: [
|
|
|
|
new ClearDistPlugin(),
|
|
|
|
new webpack.DefinePlugin({
|
|
|
|
'process.env.NODE_ENV': JSON.stringify('development')
|
|
|
|
}),
|
|
|
|
],
|
|
|
|
node: {
|
|
|
|
__dirname: false,
|
|
|
|
__filename: false
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
module.exports = electronConfig;
|