From a5bab8707165b2ac323d535ed37f3e2f9550cdb4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Tetsing?= Date: Thu, 19 Sep 2024 15:14:32 +0200 Subject: [PATCH] minor --- apps/remixdesktop/webpack.config.js | 44 +++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 apps/remixdesktop/webpack.config.js diff --git a/apps/remixdesktop/webpack.config.js b/apps/remixdesktop/webpack.config.js new file mode 100644 index 0000000000..de122e7e1e --- /dev/null +++ b/apps/remixdesktop/webpack.config.js @@ -0,0 +1,44 @@ +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' }] + }, + { + test: /\.node$/, + use: 'node-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 + } +}