38 lines
836 B
JavaScript
38 lines
836 B
JavaScript
const path = require('path');
|
|
const webpackNodeExternals = require('webpack-node-externals');
|
|
|
|
const rootPath = path.join(__dirname, '..');
|
|
|
|
module.exports = [
|
|
{
|
|
mode: process.env.ENV || 'development',
|
|
entry: path.join(rootPath, 'src', 'main'),
|
|
target: 'electron-main',
|
|
devtool: 'source-map',
|
|
externals: [webpackNodeExternals()],
|
|
resolve: {
|
|
extensions: ['.ts', '.js']
|
|
},
|
|
module: {
|
|
rules: [
|
|
{
|
|
test: /\.ts$/,
|
|
use: [
|
|
{
|
|
loader: 'ts-loader',
|
|
options: {
|
|
configFile: path.join(rootPath, 'tsconfig.app.json')
|
|
}
|
|
}
|
|
],
|
|
exclude: /node_modules/
|
|
}
|
|
]
|
|
},
|
|
output: {
|
|
path: path.join(rootPath, 'dist'),
|
|
filename: 'electron-main.js'
|
|
}
|
|
}
|
|
];
|