diff options
| author | rejbasket <39080670+rejbasket@users.noreply.github.com> | 2023-05-22 22:33:19 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-05-22 22:33:19 +0200 |
| commit | ef6f6580df6e8fbce913eecc1fe7e0f8caf1315b (patch) | |
| tree | c1119a5d1affd44ad27e60cc6981ac98534c518d /electron/service/config/main.js | |
| parent | da54f104e6bf5d0e98f7479cf1d060c76e0b01f2 (diff) | |
Update electron version to v14.2.9 (#2214)
Authored-by: rejbasket
Co-authored-by: Kaalleen
Co-authored-by: Lex Neva
Diffstat (limited to 'electron/service/config/main.js')
| -rw-r--r-- | electron/service/config/main.js | 73 |
1 files changed, 73 insertions, 0 deletions
diff --git a/electron/service/config/main.js b/electron/service/config/main.js new file mode 100644 index 00000000..3083dea0 --- /dev/null +++ b/electron/service/config/main.js @@ -0,0 +1,73 @@ +'use strict' + +const CaseSensitivePathsPlugin = require('case-sensitive-paths-webpack-plugin') +const config = require('../project.config') + +const resolveClientEnv = require('../utils/resolveClientEnv') +const paths = require('../utils/paths') +const { merge } = require('webpack-merge') +const TerserPlugin = require('terser-webpack-plugin') +const cssWebpackConfig = require('./css') +const terserOptions = require('./terserOptions') +const isProd = process.env.NODE_ENV === 'production' + +module.exports = merge(cssWebpackConfig, { + context: process.cwd(), + mode: 'production', + entry: { + main: './src/main/index.js', + preload: './src/main/preload.js', + }, + + node: { + __dirname: false, + }, + + optimization: { + minimize: true, + minimizer: [new TerserPlugin(terserOptions())], + moduleIds: 'named', + }, + target: ['electron-main'], + + output: { + path: paths.resolve(config.outputDir), + publicPath: config.dev.publicPath, + filename: '[name].js', + }, + + resolve: { + alias: { + '@': paths.resolve('src'), + }, + extensions: ['.ts', '.tsx', '.js', '.jsx', '.vue', '.json', 'html', 'ejs'], + }, + + plugins: [ + new CaseSensitivePathsPlugin(), + ], + + module: { + noParse: /^(vue|vue-router)$/, + + rules: [ + // ts + { + test: /\.tsx?$/, + use: [ + 'thread-loader', + 'babel-loader', + { + loader: 'ts-loader', + options: { + transpileOnly: true, + appendTsSuffixTo: ['\\.vue$'], + happyPackMode: true, + }, + }, + ], + }, + ], + }, +} +)
\ No newline at end of file |
