|
|
@ -4,11 +4,15 @@ const TerserPlugin = require("terser-webpack-plugin") |
|
|
|
const CssMinimizerPlugin = require("css-minimizer-webpack-plugin") |
|
|
|
const CssMinimizerPlugin = require("css-minimizer-webpack-plugin") |
|
|
|
|
|
|
|
|
|
|
|
// Nx plugins for webpack.
|
|
|
|
// Nx plugins for webpack.
|
|
|
|
module.exports = composePlugins((config) => { |
|
|
|
module.exports = composePlugins((input) => { |
|
|
|
config = {} |
|
|
|
|
|
|
|
|
|
|
|
const config = { |
|
|
|
|
|
|
|
mode: input.mode === 'production' ? 'production' : 'development', |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
config.target = 'electron-main' |
|
|
|
config.target = 'electron-main' |
|
|
|
config.devtool = 'source-map' |
|
|
|
config.devtool = 'source-map' |
|
|
|
config.mode = 'production' |
|
|
|
|
|
|
|
config.output = { |
|
|
|
config.output = { |
|
|
|
path: __dirname + '/.webpack/main', |
|
|
|
path: __dirname + '/.webpack/main', |
|
|
|
filename: '[name].js', |
|
|
|
filename: '[name].js', |
|
|
@ -20,11 +24,14 @@ module.exports = composePlugins((config) => { |
|
|
|
index: ['./apps/remixdesktop/src/index.ts'], |
|
|
|
index: ['./apps/remixdesktop/src/index.ts'], |
|
|
|
preload: ['./apps/remixdesktop/src/preload.ts'], |
|
|
|
preload: ['./apps/remixdesktop/src/preload.ts'], |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const mainEntry = config.mode === 'production'? `\`file://$\{require('path').resolve(__dirname, '..', 'renderer', 'index.html')}\``: `'http://localhost:8080'` |
|
|
|
|
|
|
|
|
|
|
|
config.plugins= [ |
|
|
|
config.plugins= [ |
|
|
|
new webpack.DefinePlugin({ |
|
|
|
new webpack.DefinePlugin({ |
|
|
|
MAIN_WINDOW_WEBPACK_ENTRY:`\`file://$\{require('path').resolve(__dirname, '..', 'renderer', 'index.html')}\``, |
|
|
|
MAIN_WINDOW_WEBPACK_ENTRY: mainEntry, |
|
|
|
'process.env.MAIN_WINDOW_WEBPACK_ENTRY': `\`file://$\{require('path').resolve(__dirname, '..', 'renderer', 'index.html')}\``, |
|
|
|
'process.env.MAIN_WINDOW_WEBPACK_ENTRY': mainEntry, |
|
|
|
MAIN_WINDOW_PRELOAD_WEBPACK_ENTRY: `\`$\{require('path').resolve(__dirname, 'preload.js')}\``, |
|
|
|
MAIN_WINDOW_PRELOAD_WEBPACK_ENTRY: `\`$\{require('path').resolve(__dirname, 'preload.js')}\``, |
|
|
|
'process.env.MAIN_WINDOW_PRELOAD_WEBPACK_ENTRY': `\`$\{require('path').resolve(__dirname, '..', 'render', 'preload.js')}\``, |
|
|
|
'process.env.MAIN_WINDOW_PRELOAD_WEBPACK_ENTRY': `\`$\{require('path').resolve(__dirname, '..', 'render', 'preload.js')}\``, |
|
|
|
}) |
|
|
|
}) |
|
|
|