MyCrypto/webpack_config/webpack.electron-dev.js

44 lines
1.0 KiB
JavaScript
Raw Normal View History

'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',
mode: 'development',
entry: {
main: path.join(config.path.electron, 'main/index.ts'),
preload: path.join(config.path.electron, 'preload/index.ts')
},
module: {
rules: [config.typescriptRule]
},
resolve: {
extensions: ['.ts', '.js', '.json'],
modules: config.resolve.modules
},
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
},
node: {
__dirname: false,
__filename: false
2018-04-27 20:49:17 +00:00
},
devtool: 'eval'
};
module.exports = electronConfig;