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-04-27 17:46:51 +00:00
|
|
|
main: path.join(config.path.electron, 'main/index.ts'),
|
|
|
|
preload: path.join(config.path.electron, 'preload/index.ts')
|
2018-01-22 23:38:06 +00:00
|
|
|
},
|
|
|
|
module: {
|
|
|
|
rules: [config.typescriptRule]
|
|
|
|
},
|
|
|
|
resolve: {
|
2018-04-27 17:46:51 +00:00
|
|
|
extensions: ['.ts', '.js', '.json'],
|
|
|
|
modules: config.resolve.modules
|
2018-01-22 23:38:06 +00:00
|
|
|
},
|
|
|
|
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')
|
|
|
|
}),
|
|
|
|
],
|
2018-04-27 20:49:17 +00:00
|
|
|
externals: {
|
|
|
|
'node-hid': 'commonjs node-hid',
|
2018-04-30 17:17:17 +00:00
|
|
|
'trezor.js-node': 'require("trezor.js-node")'
|
2018-04-27 20:49:17 +00:00
|
|
|
},
|
2018-01-22 23:38:06 +00:00
|
|
|
node: {
|
|
|
|
__dirname: false,
|
|
|
|
__filename: false
|
2018-04-27 20:49:17 +00:00
|
|
|
},
|
|
|
|
devtool: 'eval'
|
2018-01-22 23:38:06 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
module.exports = electronConfig;
|