rebuiltron 2.0.0 → 4.0.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 CHANGED
@@ -20,6 +20,7 @@ Rebuiltron uses webpack with [SWC](https://swc.rs/) to compile JavaScript instea
20
20
  - Development server taking care of starting Electron
21
21
  - Production bundler for React and Electron code
22
22
  - Support for React, JSX, SASS, ICSS
23
+ - Support for ESM
23
24
 
24
25
  > [!WARNING]
25
26
  > Rebuiltron **doesn't support**: TypeScript, Flow, CSS Modules, Jest, and proxying.
@@ -85,7 +86,7 @@ Add your desired [browserslist](https://github.com/browserslist/browserslist) in
85
86
 
86
87
  ### Configuration file
87
88
 
88
- At the root of your project, create a `rebuiltron.config.js` file.
89
+ At the root of your project, create a `rebuiltron.config.cjs` file.
89
90
 
90
91
  #### Options:
91
92
 
package/buildApp.js CHANGED
@@ -13,7 +13,7 @@ module.exports = (previousFileSizes) => {
13
13
  fsExtra.emptyDirSync(paths.appBuild);
14
14
 
15
15
  clearConsole();
16
- spinnies.add("build", { text: "Creating production build" });
16
+ spinnies.add("build", { text: "Creating the production build" });
17
17
 
18
18
  const compiler = webpack(webpackConfig);
19
19
 
package/helpers/paths.js CHANGED
@@ -19,4 +19,4 @@ module.exports = {
19
19
  appNodeModules: resolveApp("node_modules"),
20
20
  appWebpackCache: resolveApp("node_modules/.cache"),
21
21
  basePath: isEnvDevelopment ? "/" : "./"
22
- };
22
+ };
@@ -3,6 +3,17 @@ const { shouldUseSourceMap, isEnvProduction } = require("../helpers/environment"
3
3
 
4
4
 
5
5
  module.exports = [
6
+ {
7
+ // Converts `import.meta.url` before SWC transpiles so paths using it stay dynamic
8
+ test: /\.js$/,
9
+ include: [paths.electronSrc],
10
+ loader: require.resolve("string-replace-loader"),
11
+ options: {
12
+ search: "import.meta.url",
13
+ replace: "require('url').pathToFileURL(__filename).toString()",
14
+ flags: "g"
15
+ }
16
+ },
6
17
  {
7
18
  test: /\.(js|jsx)$/,
8
19
  exclude: [paths.appNodeModules],
@@ -25,6 +36,9 @@ module.exports = [
25
36
  minify: isEnvProduction,
26
37
  sourceMaps: shouldUseSourceMap
27
38
  }
39
+ },
40
+ resolve: {
41
+ fullySpecified: false // Allows extensions not to be specified on import
28
42
  }
29
43
  }
30
- ];
44
+ ];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rebuiltron",
3
- "version": "2.0.0",
3
+ "version": "4.0.0",
4
4
  "author": "Arkellys",
5
5
  "license": "MIT",
6
6
  "bin": {
@@ -10,41 +10,42 @@
10
10
  "lint": "eslint \"**/*.js\""
11
11
  },
12
12
  "devDependencies": {
13
- "eslint-config-arklint": "^1.0.3"
13
+ "eslint-config-arklint": "^1.2.2"
14
14
  },
15
15
  "dependencies": {
16
16
  "@pmmmwh/react-refresh-webpack-plugin": "^0.5.11",
17
17
  "@svgr/webpack": "^8.1.0",
18
- "@swc/core": "^1.3.93",
19
- "browserslist": "^4.22.1",
18
+ "@swc/core": "^1.3.107",
19
+ "browserslist": "^4.22.3",
20
20
  "case-sensitive-paths-webpack-plugin": "^2.4.0",
21
- "copy-webpack-plugin": "^11.0.0",
22
- "css-loader": "^6.5.1",
23
- "css-minimizer-webpack-plugin": "^5.0.1",
21
+ "copy-webpack-plugin": "^12.0.2",
22
+ "css-loader": "^6.10.0",
23
+ "css-minimizer-webpack-plugin": "^6.0.0",
24
24
  "detect-port": "^1.5.1",
25
- "fs-extra": "^11.1.1",
26
- "html-webpack-plugin": "^5.5.0",
25
+ "fs-extra": "^11.2.0",
26
+ "html-webpack-plugin": "^5.6.0",
27
27
  "lodash": "^4.17.21",
28
- "mini-css-extract-plugin": "^2.4.5",
29
- "postcss": "^8.4.31",
28
+ "mini-css-extract-plugin": "^2.8.0",
29
+ "postcss": "^8.4.33",
30
30
  "postcss-flexbugs-fixes": "^5.0.2",
31
- "postcss-loader": "^7.3.3",
31
+ "postcss-loader": "^8.1.0",
32
32
  "postcss-normalize": "^10.0.1",
33
- "postcss-preset-env": "^9.2.0",
33
+ "postcss-preset-env": "^9.3.0",
34
34
  "react-dev-utils": "^12.0.1",
35
35
  "react-refresh": "^0.14.0",
36
36
  "resolve-url-loader": "^5.0.0",
37
- "sass-loader": "^13.3.2",
38
- "source-map-loader": "^4.0.1",
37
+ "sass-loader": "^14.1.0",
38
+ "source-map-loader": "^5.0.0",
39
39
  "spinnies": "^0.5.1",
40
- "style-loader": "^3.3.1",
41
- "swc-loader": "^0.2.3",
42
- "terser-webpack-plugin": "^5.2.5",
43
- "webpack": "^5.89.0",
40
+ "string-replace-loader": "^3.1.0",
41
+ "style-loader": "^3.3.4",
42
+ "swc-loader": "^0.2.4",
43
+ "terser-webpack-plugin": "^5.3.10",
44
+ "webpack": "^5.90.1",
44
45
  "webpack-dev-server": "^4.6.0"
45
46
  },
46
47
  "peerDependencies": {
47
- "electron": ">=25.0.0",
48
+ "electron": ">=28.0.0",
48
49
  "react": ">=18.0.0",
49
50
  "react-dom": ">=18.0.0"
50
51
  },
@@ -1,5 +1,5 @@
1
1
  module.exports = {
2
- configFileName: "rebuiltron.config.js",
2
+ configFileName: "rebuiltron.config.cjs",
3
3
  buildDirs: {
4
4
  js: "static/js",
5
5
  media: "static/media",
package/webpack.config.js CHANGED
@@ -4,4 +4,4 @@ const preloadConfig = require("./configurations/preloads");
4
4
  const mainConfig = require("./configurations/main");
5
5
 
6
6
 
7
- module.exports = isEnvDevelopment ? rendererConfig : [rendererConfig, mainConfig, preloadConfig];
7
+ module.exports = isEnvDevelopment ? rendererConfig : [rendererConfig, mainConfig, preloadConfig];
@@ -29,4 +29,4 @@ module.exports = {
29
29
  evalSourceMapMiddleware(devServer), // Fetches source contents from webpack for the error overlay
30
30
  redirectServedPath(paths.basePath) // Redirects to `basePath` if url not match
31
31
  ])
32
- };
32
+ };