Skip to content

Commit

Permalink
Always use mode production for main and preloads
Browse files Browse the repository at this point in the history
  • Loading branch information
Arkellys committed Sep 16, 2024
1 parent 4b97012 commit 28d8ea8
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 9 deletions.
5 changes: 1 addition & 4 deletions configurations/base.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ const { srcAlias } = require(paths.appConfig);


module.exports = {
mode: isEnvProduction ? "production" : "development",
stats: "errors-warnings",
bail: isEnvProduction,
output: {
Expand Down Expand Up @@ -69,9 +68,7 @@ module.exports = {
strictExportPresence: true
},
plugins: [
...emptyOr(isEnvDevelopment, [
new CaseSensitivePathsPlugin() // Detects case errors in import paths
]),
...emptyOr(isEnvDevelopment, [new CaseSensitivePathsPlugin()]), // Detects case errors in import paths
new ModuleNotFoundPlugin(paths.appPath) // Gives some necessary context to module not found errors
],
performance: false // Performance processing is already handled via `FileSizeReporter`
Expand Down
1 change: 1 addition & 0 deletions configurations/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ const { main } = require(paths.appConfig);

module.exports = {
...baseConfig,
mode: "production",
target: "electron-main",
entry: {
[rebuiltronConfig.buildFileNames.main]: main
Expand Down
9 changes: 4 additions & 5 deletions configurations/preloads.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ const { preloads } = require(paths.appConfig);

module.exports = {
...baseConfig,
mode: "production",
target: "electron-preload",
entry: mapKeys(preloads, (_value, entryName) => (
`${rebuiltronConfig.buildFileNames.preload}.${entryName}`
Expand All @@ -21,10 +22,8 @@ module.exports = {
},
module: {
...baseConfig.module,
rules: [
{
oneOf: javascriptLoaders
}
]
rules: [{
oneOf: javascriptLoaders
}]
}
};
1 change: 1 addition & 0 deletions configurations/renderers.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ const { renderers } = require(paths.appConfig);

module.exports = {
...baseConfig,
mode: isEnvProduction ? "production" : "development",
target: "browserslist",
devtool: shouldUseSourceMap && (isEnvProduction ? "source-map" : "cheap-module-source-map"),
entry: renderers,
Expand Down

0 comments on commit 28d8ea8

Please sign in to comment.