2020-05-31 10:24:52 +02:00
|
|
|
const HtmlWebpackPlugin = require('html-webpack-plugin');
|
2020-07-19 08:55:39 +02:00
|
|
|
const HardSourceWebpackPlugin = require('hard-source-webpack-plugin');
|
2020-05-31 10:24:52 +02:00
|
|
|
|
|
|
|
module.exports = [
|
|
|
|
{
|
2020-06-15 08:16:49 +02:00
|
|
|
mode: 'production',
|
2020-05-31 10:24:52 +02:00
|
|
|
entry: './src/electron.ts',
|
|
|
|
target: 'electron-main',
|
|
|
|
module: {
|
|
|
|
rules: [{
|
|
|
|
test: /\.ts$/,
|
|
|
|
include: /src/,
|
2020-06-15 11:25:55 +02:00
|
|
|
resolve: {
|
|
|
|
extensions: ['.ts', '.js']
|
|
|
|
},
|
2020-05-31 10:24:52 +02:00
|
|
|
use: [{ loader: 'ts-loader' }]
|
|
|
|
}]
|
|
|
|
},
|
|
|
|
output: {
|
2020-06-30 13:15:37 +02:00
|
|
|
devtoolModuleFilenameTemplate: '[absolute-resource-path]',
|
2020-05-31 10:24:52 +02:00
|
|
|
path: __dirname + '/dist',
|
|
|
|
filename: 'electron.js'
|
2020-07-19 08:55:39 +02:00
|
|
|
},
|
|
|
|
plugins: [
|
|
|
|
new HardSourceWebpackPlugin()
|
|
|
|
]
|
2020-05-31 10:24:52 +02:00
|
|
|
},
|
2020-06-29 13:17:33 +02:00
|
|
|
{
|
|
|
|
mode: 'production',
|
|
|
|
entry: './src/preload.ts',
|
|
|
|
target: 'electron-preload',
|
|
|
|
module: {
|
|
|
|
rules: [{
|
|
|
|
test: /\.ts$/,
|
|
|
|
include: /src/,
|
|
|
|
resolve: {
|
|
|
|
extensions: ['.ts', '.js']
|
|
|
|
},
|
|
|
|
use: [{ loader: 'ts-loader' }]
|
|
|
|
}]
|
|
|
|
},
|
|
|
|
output: {
|
|
|
|
path: __dirname + '/dist',
|
|
|
|
filename: 'preload.js'
|
2020-07-19 08:55:39 +02:00
|
|
|
},
|
|
|
|
plugins: [
|
|
|
|
new HardSourceWebpackPlugin()
|
|
|
|
]
|
2020-06-29 13:17:33 +02:00
|
|
|
},
|
2020-05-31 10:24:52 +02:00
|
|
|
{
|
2020-06-09 08:03:38 +02:00
|
|
|
mode: 'production',
|
2020-05-31 10:24:52 +02:00
|
|
|
entry: './src/index.tsx',
|
2020-06-30 13:15:37 +02:00
|
|
|
target: 'web',
|
2020-05-31 10:24:52 +02:00
|
|
|
devtool: 'source-map',
|
2020-06-30 13:15:37 +02:00
|
|
|
performance: {
|
|
|
|
hints: false
|
|
|
|
},
|
2020-05-31 10:24:52 +02:00
|
|
|
module: {
|
|
|
|
rules: [{
|
|
|
|
test: /\.ts(x?)$/,
|
|
|
|
include: /src/,
|
|
|
|
resolve: {
|
|
|
|
extensions: ['.ts', '.tsx', '.js']
|
|
|
|
},
|
|
|
|
use: [{ loader: 'ts-loader' }]
|
|
|
|
}]
|
|
|
|
},
|
|
|
|
output: {
|
|
|
|
path: __dirname + '/dist',
|
|
|
|
filename: 'index.js'
|
|
|
|
},
|
|
|
|
plugins: [
|
2020-07-19 08:55:39 +02:00
|
|
|
new HardSourceWebpackPlugin(),
|
2020-05-31 10:24:52 +02:00
|
|
|
new HtmlWebpackPlugin({
|
|
|
|
template: './src/index.html'
|
|
|
|
})
|
|
|
|
]
|
|
|
|
}
|
|
|
|
];
|