@rspack/test-tools 1.3.0-beta.1 → 1.3.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.
@@ -4,3 +4,4 @@ export * from "./read-config-file";
4
4
  export * from "./update-snapshot";
5
5
  export * from "./win";
6
6
  export * from "./util/checkStats";
7
+ export * from "./legacy/supportsImportFn";
@@ -20,3 +20,4 @@ __exportStar(require("./read-config-file"), exports);
20
20
  __exportStar(require("./update-snapshot"), exports);
21
21
  __exportStar(require("./win"), exports);
22
22
  __exportStar(require("./util/checkStats"), exports);
23
+ __exportStar(require("./legacy/supportsImportFn"), exports);
@@ -0,0 +1 @@
1
+ export declare function supportsImportFn(): boolean;
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.supportsImportFn = supportsImportFn;
4
+ // @ts-nocheck
5
+ const nodeVersion = process.versions.node.split(".").map(Number);
6
+ function supportsImportFn() {
7
+ // Segmentation fault in vm with --experimental-vm-modules,
8
+ // which has not been resolved in node 16 yet.
9
+ // https://github.com/nodejs/node/issues/35889
10
+ if (nodeVersion[0] > 16) {
11
+ return true;
12
+ }
13
+ return false;
14
+ }
15
+ ;
@@ -108,7 +108,9 @@ class BasicProcessor {
108
108
  node_fs_1.default.writeFileSync(node_path_1.default.join(context.getDist(), "stats.json"), JSON.stringify(jsonStats, null, 2), "utf-8");
109
109
  }
110
110
  if (node_fs_1.default.existsSync(context.getSource("errors.js")) ||
111
- node_fs_1.default.existsSync(context.getSource("warnings.js"))) {
111
+ node_fs_1.default.existsSync(context.getSource("warnings.js")) ||
112
+ stats.hasErrors() ||
113
+ stats.hasWarnings()) {
112
114
  const statsJson = stats.toJson({
113
115
  errorDetails: true
114
116
  });
@@ -111,7 +111,9 @@ class WatchProcessor extends multi_1.MultiTaskProcessor {
111
111
  node_fs_1.default.writeFileSync(node_path_1.default.join(context.getDist(), "stats.json"), JSON.stringify(getJsonStats(), null, 2), "utf-8");
112
112
  }
113
113
  if (node_fs_1.default.existsSync(context.getSource(`${this._watchOptions.stepName}/errors.js`)) ||
114
- node_fs_1.default.existsSync(context.getSource(`${this._watchOptions.stepName}/warnings.js`))) {
114
+ node_fs_1.default.existsSync(context.getSource(`${this._watchOptions.stepName}/warnings.js`)) ||
115
+ stats.hasErrors() ||
116
+ stats.hasWarnings()) {
115
117
  const statsJson = stats.toJson({
116
118
  errorDetails: true
117
119
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rspack/test-tools",
3
- "version": "1.3.0-beta.1",
3
+ "version": "1.3.1",
4
4
  "license": "MIT",
5
5
  "description": "Test tools for rspack",
6
6
  "main": "dist/index.js",
@@ -97,9 +97,9 @@
97
97
  "typescript": "^5.7.3",
98
98
  "wast-loader": "^1.14.1",
99
99
  "worker-rspack-loader": "^3.1.2",
100
- "@rspack/cli": "1.3.0-beta.1",
101
- "@rspack/core": "1.3.0-beta.1",
102
- "@rspack/test-tools": "1.3.0-beta.1"
100
+ "@rspack/test-tools": "1.3.1",
101
+ "@rspack/core": "1.3.1",
102
+ "@rspack/cli": "1.3.1"
103
103
  },
104
104
  "peerDependencies": {
105
105
  "@rspack/core": ">=1.0.0"