rebuiltron 6.1.0 → 6.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -9,7 +9,7 @@ A tool made to easily build an offline **React/Electron** app using webpack.
9
9
  The idea behind Rebuiltron was to migrate one of my project initially created with the deprecated [CRA](https://create-react-app.dev/) to a maintained tool configured with Electron in mind. As such, it has been developed using [react-scripts](https://github.com/facebook/create-react-app/tree/main/packages/react-scripts) as a base, but heavily edited and stripped of a lot of features.
10
10
 
11
11
  > [!IMPORTANT]
12
- > Since I made Rebuiltron specifically for one of my own projects, I only kept in the configuration what *this* project needed and nothing more. Except for the entry points and some basic options, **Rebuiltron doesn't offer many configurable options**. If you are looking to create a new Electron/React app, or even migrating an existing CRA app, you should probably look for a more generic tool.
12
+ > Since I made Rebuiltron specifically for one of my own projects, I only kept in the configuration what *this* project needed and nothing more. For this reason, **Rebuiltron doesn't offer many configurable options**. If you are looking to create a new Electron/React app, or even migrating an existing CRA app, you should probably look for a more generic tool.
13
13
 
14
14
 
15
15
  ## Features
@@ -23,7 +23,7 @@ Rebuiltron uses webpack with [SWC](https://swc.rs/) to compile JavaScript instea
23
23
  - Support for ES6 imports on all processes
24
24
 
25
25
  > [!WARNING]
26
- > Rebuiltron **doesn't support**: TypeScript, Flow, CSS Modules, ESM, Jest, and proxying.
26
+ > Rebuiltron **doesn't support**: TypeScript, Flow, CSS Modules, ESM, and proxying.
27
27
 
28
28
 
29
29
  ## Installation
@@ -96,6 +96,7 @@ At the root of your project, create a `rebuiltron.config.js` file.
96
96
  | `renderers` | `object` | ✓ | Renderer entries. It takes the name of the entries as keys and their paths as values. All paths must be relative. |
97
97
  | `preloads` | `object` | ✓ | Preload entries. It takes the name of the entries as keys and their paths as values. All paths must be relative. |
98
98
  | `srcAlias` | `string` | ✗ | Custom [alias](https://webpack.js.org/configuration/resolve/#resolvealias) to the `src` folder.
99
+ | `excludeInProduction` | `string[]` | ✗ | List of modules to exclude in the production bundle.
99
100
  | `sassOptions` | `object` | ✗ | Custom SASS options for [`sass-loader`](https://github.com/webpack-contrib/sass-loader). |
100
101
  | `sassOptions.additionalData` | `object` | ✗* | Configuration of [`additionalData`](https://webpack.js.org/loaders/sass-loader/#additionaldata). |
101
102
  | `sassOptions.additionalData.data` | `string` | ✗* | Data to prepend to SASS files. |
@@ -121,7 +122,10 @@ module.exports = {
121
122
  data: "@use \"styles/settings\" as *;",
122
123
  exclude: /^src\\styles\\.*/
123
124
  }
124
- }
125
+ },
126
+ excludeInProduction: [
127
+ "electron-devtools-installer"
128
+ ]
125
129
  };
126
130
  ```
127
131
 
@@ -1,15 +1,17 @@
1
1
  const { createHash } = require("crypto");
2
2
 
3
3
  const CaseSensitivePathsPlugin = require("case-sensitive-paths-webpack-plugin");
4
+ const { isEmpty } = require("lodash");
4
5
  const ModuleNotFoundPlugin = require("react-dev-utils/ModuleNotFoundPlugin");
5
6
  const TerserPlugin = require("terser-webpack-plugin");
7
+ const { IgnorePlugin } = require("webpack");
6
8
 
7
9
  const { isEnvDevelopment, isEnvProduction } = require("../helpers/environment");
8
10
  const paths = require("../helpers/paths");
9
11
  const { emptyOr } = require("../helpers/utils");
10
12
 
11
13
 
12
- const { srcAlias } = require(paths.appConfig);
14
+ const { srcAlias, excludeInProduction } = require(paths.appConfig);
13
15
 
14
16
 
15
17
  module.exports = {
@@ -68,8 +70,17 @@ module.exports = {
68
70
  strictExportPresence: true
69
71
  },
70
72
  plugins: [
71
- ...emptyOr(isEnvDevelopment, [new CaseSensitivePathsPlugin()]), // Detects case errors in import paths
72
- new ModuleNotFoundPlugin(paths.appPath) // Gives some necessary context to module not found errors
73
+ ...emptyOr(isEnvDevelopment, [
74
+ new CaseSensitivePathsPlugin()
75
+ ]),
76
+ ...emptyOr(isEnvProduction && !isEmpty(excludeInProduction), [
77
+ new IgnorePlugin({
78
+ checkResource(resource) {
79
+ return excludeInProduction.includes(resource);
80
+ }
81
+ })
82
+ ]),
83
+ new ModuleNotFoundPlugin(paths.appPath)
73
84
  ],
74
- performance: false // Performance processing is already handled via `FileSizeReporter`
85
+ performance: false // Already handled via `FileSizeReporter`
75
86
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rebuiltron",
3
- "version": "6.1.0",
3
+ "version": "6.2.1",
4
4
  "author": "Arkellys",
5
5
  "license": "MIT",
6
6
  "bin": {
@@ -10,40 +10,40 @@
10
10
  "lint": "eslint ."
11
11
  },
12
12
  "devDependencies": {
13
- "eslint": "^9.14.0",
14
- "eslint-config-arklint": "^3.3.0"
13
+ "eslint": "^9.18.0",
14
+ "eslint-config-arklint": "^3.3.2"
15
15
  },
16
16
  "dependencies": {
17
17
  "@pmmmwh/react-refresh-webpack-plugin": "^0.5.15",
18
18
  "@svgr/webpack": "^8.1.0",
19
- "@swc/core": "^1.7.42",
20
- "@swc/plugin-transform-imports": "^4.0.0",
21
- "browserslist": "^4.24.2",
19
+ "@swc/core": "^1.10.7",
20
+ "@swc/plugin-transform-imports": "^6.0.5",
21
+ "browserslist": "^4.24.4",
22
22
  "case-sensitive-paths-webpack-plugin": "^2.4.0",
23
23
  "copy-webpack-plugin": "^12.0.2",
24
24
  "css-loader": "^7.1.2",
25
25
  "css-minimizer-webpack-plugin": "^7.0.0",
26
- "detect-port": "^1.6.1",
27
- "fs-extra": "^11.2.0",
26
+ "detect-port": "^2.1.0",
27
+ "fs-extra": "^11.3.0",
28
28
  "html-webpack-plugin": "^5.6.3",
29
29
  "lodash": "^4.17.21",
30
30
  "mini-css-extract-plugin": "^2.9.2",
31
- "postcss": "^8.4.47",
31
+ "postcss": "^8.5.1",
32
32
  "postcss-flexbugs-fixes": "^5.0.2",
33
33
  "postcss-loader": "^8.1.1",
34
34
  "postcss-normalize": "^13.0.1",
35
- "postcss-preset-env": "^10.0.9",
35
+ "postcss-preset-env": "^10.1.3",
36
36
  "react-dev-utils": "^12.0.1",
37
- "react-refresh": "^0.14.2",
37
+ "react-refresh": "^0.16.0",
38
38
  "resolve-url-loader": "^5.0.0",
39
- "sass-loader": "^16.0.3",
39
+ "sass-loader": "^16.0.4",
40
40
  "source-map-loader": "^5.0.0",
41
41
  "spinnies": "^0.5.1",
42
42
  "style-loader": "^4.0.0",
43
43
  "swc-loader": "^0.2.6",
44
- "terser-webpack-plugin": "^5.3.10",
45
- "webpack": "^5.96.1",
46
- "webpack-dev-server": "^5.1.0"
44
+ "terser-webpack-plugin": "^5.3.11",
45
+ "webpack": "^5.97.1",
46
+ "webpack-dev-server": "^5.2.0"
47
47
  },
48
48
  "peerDependencies": {
49
49
  "electron": ">=32.0.0",