parent
9f83e29175
commit
576896793f
@ -0,0 +1,40 @@ |
||||
const path = require('path'); |
||||
const nodeExternals = require('webpack-node-externals'); |
||||
const TsconfigPathsPlugin = require('tsconfig-paths-webpack-plugin'); |
||||
const mode = process.env.NODE_ENV || 'development'; |
||||
const webpack = require('webpack'); |
||||
module.exports = { |
||||
mode, |
||||
entry: { |
||||
main: './src/main.ts', |
||||
preload: './src/preload.ts', |
||||
}, |
||||
target: 'electron-main', |
||||
externals: [nodeExternals()], |
||||
module: { |
||||
rules: [ |
||||
{ |
||||
test: /\.ts$/, |
||||
include: /src/, |
||||
use: [{ loader: 'ts-loader' }] |
||||
} |
||||
] |
||||
}, |
||||
resolve: { |
||||
extensions: ['.ts', '.js'], |
||||
plugins: [new TsconfigPathsPlugin({ configFile: './tsconfig.json' })] |
||||
}, |
||||
plugins: [ |
||||
new webpack.DefinePlugin({ |
||||
'process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV || mode) |
||||
}) |
||||
], |
||||
output: { |
||||
path: path.resolve(__dirname, 'build'), |
||||
filename: '[name].js' |
||||
}, |
||||
node: { |
||||
__dirname: false, |
||||
__filename: false |
||||
} |
||||
} |
File diff suppressed because it is too large
Load Diff
Loading…
Reference in new issue