@webiny/build-tools 6.4.0-beta.3 → 6.4.0-beta.5
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.
|
@@ -8,7 +8,7 @@ export const createBuildFunction =
|
|
|
8
8
|
|
|
9
9
|
// Must be a dynamic import — see rslibCompile.js for the reason.
|
|
10
10
|
const { createRsbuild } = await import("@rsbuild/core");
|
|
11
|
-
const rsbuildConfig = await createRsbuildConfig({ cwd });
|
|
11
|
+
const rsbuildConfig = await createRsbuildConfig({ cwd, enforceMaxBundleSize: true });
|
|
12
12
|
|
|
13
13
|
const rsbuild = await createRsbuild({ rsbuildConfig });
|
|
14
14
|
|
|
@@ -4,7 +4,7 @@ import { createImportValidatorPlugin } from "../importValidatorPlugin.js";
|
|
|
4
4
|
|
|
5
5
|
const DEFAULT_WEBINY_INFRA_API_MAX_BUNDLE_SIZE = 4_718_592; // 4.5 MB
|
|
6
6
|
|
|
7
|
-
export const createRsbuildConfig = async ({ cwd }) => {
|
|
7
|
+
export const createRsbuildConfig = async ({ cwd, enforceMaxBundleSize }) => {
|
|
8
8
|
// Must be a dynamic import — see rslibCompile.js for the reason.
|
|
9
9
|
const { default: rspack } = await import("@rspack/core");
|
|
10
10
|
const paths = getPaths(cwd);
|
|
@@ -12,6 +12,7 @@ export const createRsbuildConfig = async ({ cwd }) => {
|
|
|
12
12
|
const isDebugEnabled = process.env.DEBUG === "true";
|
|
13
13
|
|
|
14
14
|
// Configurable via WEBINY_INFRA_API_MAX_BUNDLE_SIZE (bytes).
|
|
15
|
+
// Only enforced during build — watch mode skips size checks.
|
|
15
16
|
const maxBundleSize =
|
|
16
17
|
parseInt(process.env.WEBINY_INFRA_API_MAX_BUNDLE_SIZE) ||
|
|
17
18
|
DEFAULT_WEBINY_INFRA_API_MAX_BUNDLE_SIZE;
|
|
@@ -40,11 +41,13 @@ export const createRsbuildConfig = async ({ cwd }) => {
|
|
|
40
41
|
},
|
|
41
42
|
tools: {
|
|
42
43
|
rspack: {
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
44
|
+
...(enforceMaxBundleSize && {
|
|
45
|
+
performance: {
|
|
46
|
+
hints: "error",
|
|
47
|
+
maxEntrypointSize: maxBundleSize,
|
|
48
|
+
maxAssetSize: maxBundleSize
|
|
49
|
+
}
|
|
50
|
+
}),
|
|
48
51
|
externals: [/^@aws-sdk/, /^aws-sdk$/, /^sharp$/],
|
|
49
52
|
plugins: [
|
|
50
53
|
// This is necessary to enable JSDOM usage in Lambda.
|
|
@@ -7,7 +7,7 @@ export const createWatchFunction =
|
|
|
7
7
|
|
|
8
8
|
// Must be a dynamic import — see rslibCompile.js for the reason.
|
|
9
9
|
const { createRsbuild } = await import("@rsbuild/core");
|
|
10
|
-
const rsbuildConfig = await createRsbuildConfig({ cwd });
|
|
10
|
+
const rsbuildConfig = await createRsbuildConfig({ cwd, enforceMaxBundleSize: false });
|
|
11
11
|
|
|
12
12
|
const rsbuild = await createRsbuild({ rsbuildConfig });
|
|
13
13
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webiny/build-tools",
|
|
3
|
-
"version": "6.4.0-beta.
|
|
3
|
+
"version": "6.4.0-beta.5",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": "./index.js",
|
|
@@ -17,14 +17,15 @@
|
|
|
17
17
|
"Adrian Smijulj <adrian@webiny.com>"
|
|
18
18
|
],
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"@rsbuild/core": "2.0.
|
|
20
|
+
"@rsbuild/core": "2.0.7",
|
|
21
21
|
"@rsbuild/plugin-react": "2.0.0",
|
|
22
22
|
"@rsbuild/plugin-sass": "1.5.2",
|
|
23
23
|
"@rsbuild/plugin-svgr": "2.0.2",
|
|
24
24
|
"@rsbuild/plugin-type-check": "1.3.4",
|
|
25
|
+
"@rsdoctor/rspack-plugin": "1.5.11",
|
|
25
26
|
"@rslib/core": "0.21.5",
|
|
26
|
-
"@rspack/core": "2.0.
|
|
27
|
-
"@swc/plugin-emotion": "14.
|
|
27
|
+
"@rspack/core": "2.0.4",
|
|
28
|
+
"@swc/plugin-emotion": "14.10.0",
|
|
28
29
|
"@tailwindcss/postcss": "4.3.0",
|
|
29
30
|
"chalk": "5.6.2",
|
|
30
31
|
"css-loader": "7.1.4",
|
|
@@ -39,8 +40,8 @@
|
|
|
39
40
|
"react-dom": "18.3.1",
|
|
40
41
|
"react-refresh": "0.18.0",
|
|
41
42
|
"rimraf": "6.1.3",
|
|
42
|
-
"sass": "1.
|
|
43
|
-
"sass-loader": "
|
|
43
|
+
"sass": "1.100.0",
|
|
44
|
+
"sass-loader": "17.0.0",
|
|
44
45
|
"style-loader": "4.0.0",
|
|
45
46
|
"ts-morph": "28.0.0",
|
|
46
47
|
"tsx": "4.21.0",
|
|
@@ -68,13 +69,13 @@
|
|
|
68
69
|
"bufferutil",
|
|
69
70
|
"utf-8-validate",
|
|
70
71
|
"css-loader",
|
|
71
|
-
"url-loader"
|
|
72
|
+
"url-loader",
|
|
73
|
+
"@rsdoctor/rspack-plugin"
|
|
72
74
|
]
|
|
73
75
|
}
|
|
74
76
|
},
|
|
75
77
|
"publishConfig": {
|
|
76
|
-
"access": "public"
|
|
77
|
-
"directory": "."
|
|
78
|
+
"access": "public"
|
|
78
79
|
},
|
|
79
|
-
"gitHead": "
|
|
80
|
+
"gitHead": "b8aec8a1be3f25c3b428b357fe1e352c7cbff9ae"
|
|
80
81
|
}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* This tool will re-link monorepo packages to one of the following directories (by priority):
|
|
3
|
-
* - {package}/package.json ->
|
|
4
|
-
* - lerna.json -> command.publish.contents
|
|
3
|
+
* - {package}/package.json -> webiny.publishFrom
|
|
5
4
|
* - package root directory
|
|
6
5
|
*/
|
|
7
6
|
|
|
@@ -11,7 +10,6 @@ import path from "path";
|
|
|
11
10
|
import get from "lodash/get.js";
|
|
12
11
|
import fs from "fs-extra";
|
|
13
12
|
import * as rimraf from "rimraf";
|
|
14
|
-
import { loadJsonFileSync } from "load-json-file";
|
|
15
13
|
|
|
16
14
|
async function symlink(src, dest) {
|
|
17
15
|
if (process.platform !== "win32") {
|
|
@@ -71,9 +69,6 @@ export const linkWorkspaces = async ({ whitelist, blacklist } = defaults) => {
|
|
|
71
69
|
return whitelist.some(w => pkg.startsWith(w));
|
|
72
70
|
});
|
|
73
71
|
|
|
74
|
-
const lernaJson = path.resolve("lerna.json");
|
|
75
|
-
const lerna = fs.existsSync(lernaJson) ? loadJsonFileSync(lernaJson) : null;
|
|
76
|
-
|
|
77
72
|
for (let i = 0; i < packages.length; i++) {
|
|
78
73
|
const packageJson = path.resolve(packages[i], "package.json");
|
|
79
74
|
if (!fs.existsSync(packageJson)) {
|
|
@@ -83,11 +78,7 @@ export const linkWorkspaces = async ({ whitelist, blacklist } = defaults) => {
|
|
|
83
78
|
const pkgJson = await PackageJson.fromFile(packageJson);
|
|
84
79
|
const pkg = pkgJson.getJson();
|
|
85
80
|
|
|
86
|
-
|
|
87
|
-
if (!targetDirectory && lerna) {
|
|
88
|
-
targetDirectory = get(lerna, "command.publish.contents");
|
|
89
|
-
}
|
|
90
|
-
|
|
81
|
+
const targetDirectory = get(pkg, "webiny.publishFrom");
|
|
91
82
|
const link = path.resolve("node_modules", pkg.name);
|
|
92
83
|
const target = path.resolve(packages[i], targetDirectory || ".");
|
|
93
84
|
|