rebuiltron 6.2.4 → 6.3.0
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 +1 -2
- package/configurations/base.js +8 -6
- package/helpers/paths.js +1 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -21,6 +21,7 @@ Rebuiltron uses webpack with [SWC](https://swc.rs/) to compile JavaScript instea
|
|
|
21
21
|
- Production bundler for React and Electron code
|
|
22
22
|
- Support for React, JSX, SASS, ICSS
|
|
23
23
|
- Support for ES6 imports on all processes
|
|
24
|
+
- Support for paths aliases (reading the [`paths`](https://www.typescriptlang.org/tsconfig/#paths) field of `jsconfig.json`)
|
|
24
25
|
|
|
25
26
|
> [!WARNING]
|
|
26
27
|
> Rebuiltron **doesn't support**: TypeScript, Flow, CSS Modules, ESM, and proxying.
|
|
@@ -95,7 +96,6 @@ At the root of your project, create a `rebuiltron.config.js` file.
|
|
|
95
96
|
| `main` | `string` | ✓ | Main entry. The path must be relative.
|
|
96
97
|
| `renderers` | `object` | ✓ | Renderer entries. It takes the name of the entries as keys and their paths as values. All paths must be relative. |
|
|
97
98
|
| `preloads` | `object` | ✓ | Preload entries. It takes the name of the entries as keys and their paths as values. All paths must be relative. |
|
|
98
|
-
| `srcAlias` | `string` | ✗ | Custom [alias](https://webpack.js.org/configuration/resolve/#resolvealias) to the `src` folder.
|
|
99
99
|
| `excludeInProduction` | `string[]` | ✗ | List of modules to exclude in the production bundle.
|
|
100
100
|
| `sassOptions` | `object` | ✗ | Custom SASS options for [`sass-loader`](https://github.com/webpack-contrib/sass-loader). |
|
|
101
101
|
| `sassOptions.additionalData` | `object` | ✗* | Configuration of [`additionalData`](https://webpack.js.org/loaders/sass-loader/#additionaldata). |
|
|
@@ -116,7 +116,6 @@ module.exports = {
|
|
|
116
116
|
preloads: {
|
|
117
117
|
app: "./electron/preloads/app.js"
|
|
118
118
|
},
|
|
119
|
-
srcAlias: "@app",
|
|
120
119
|
sassOptions: {
|
|
121
120
|
additionalData: {
|
|
122
121
|
data: "@use \"styles/settings\" as *;",
|
package/configurations/base.js
CHANGED
|
@@ -8,10 +8,11 @@ const { IgnorePlugin } = require("webpack");
|
|
|
8
8
|
|
|
9
9
|
const { isEnvDevelopment, isEnvProduction } = require("../helpers/environment");
|
|
10
10
|
const paths = require("../helpers/paths");
|
|
11
|
-
const { emptyOr } = require("../helpers/utils");
|
|
11
|
+
const { emptyOr, resolveApp } = require("../helpers/utils");
|
|
12
12
|
|
|
13
13
|
|
|
14
|
-
const {
|
|
14
|
+
const { excludeInProduction } = require(paths.appConfig);
|
|
15
|
+
const { compilerOptions } = require(paths.jsConfig);
|
|
15
16
|
|
|
16
17
|
|
|
17
18
|
module.exports = {
|
|
@@ -38,10 +39,11 @@ module.exports = {
|
|
|
38
39
|
resolve: {
|
|
39
40
|
modules: ["node_modules", paths.appNodeModules, paths.src],
|
|
40
41
|
extensions: [".web.js", ".js", ".json", ".jsx", ".node"],
|
|
41
|
-
...emptyOr(
|
|
42
|
-
alias: {
|
|
43
|
-
|
|
44
|
-
|
|
42
|
+
...emptyOr(compilerOptions?.paths, {
|
|
43
|
+
alias: Object.entries(compilerOptions.paths).reduce((aliases, [alias, [path]]) => ({
|
|
44
|
+
...aliases,
|
|
45
|
+
[alias]: resolveApp(path)
|
|
46
|
+
}), {})
|
|
45
47
|
})
|
|
46
48
|
},
|
|
47
49
|
optimization: {
|
package/helpers/paths.js
CHANGED
|
@@ -10,6 +10,7 @@ module.exports = {
|
|
|
10
10
|
appBuild: resolveApp(rebuiltronConfig.appDirs.build),
|
|
11
11
|
appPublic: resolveApp(rebuiltronConfig.appDirs.public),
|
|
12
12
|
src: resolveApp(rebuiltronConfig.appDirs.src),
|
|
13
|
+
jsConfig: resolveApp("jsconfig.json"),
|
|
13
14
|
appNodeModules: resolveApp("node_modules"),
|
|
14
15
|
appWebpackCache: resolveApp("node_modules/.cache"),
|
|
15
16
|
basePath: isEnvDevelopment ? "/" : "./"
|