@rspack-canary/test-tools 1.6.8-canary-2fd81281-20251216180302 → 1.7.0-canary-a0fc091c-20251217174017
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/dist/case/builtin.js +1 -0
- package/dist/case/cache.js +1 -2
- package/dist/case/config.js +1 -2
- package/dist/case/diagnostic.js +1 -2
- package/dist/case/esm-output.js +4 -0
- package/dist/case/hash.js +1 -2
- package/dist/case/hook.js +1 -2
- package/dist/case/hot.js +1 -2
- package/dist/case/normal.js +1 -1
- package/dist/case/stats-output.js +1 -2
- package/dist/helper/legacy/createFakeWorker.js +19 -1
- package/package.json +2 -2
package/dist/case/builtin.js
CHANGED
package/dist/case/cache.js
CHANGED
package/dist/case/config.js
CHANGED
package/dist/case/diagnostic.js
CHANGED
package/dist/case/esm-output.js
CHANGED
|
@@ -101,6 +101,10 @@ const defaultOptions = (_index, context) => ({
|
|
|
101
101
|
chunkIds: "named",
|
|
102
102
|
runtimeChunk: "single"
|
|
103
103
|
},
|
|
104
|
+
externals: {
|
|
105
|
+
fs: "module-import fs",
|
|
106
|
+
path: "module-import path"
|
|
107
|
+
},
|
|
104
108
|
plugins: [new core_1.default.experiments.EsmLibraryPlugin()],
|
|
105
109
|
experiments: {
|
|
106
110
|
css: true,
|
package/dist/case/hash.js
CHANGED
package/dist/case/hook.js
CHANGED
package/dist/case/hot.js
CHANGED
package/dist/case/normal.js
CHANGED
|
@@ -111,6 +111,7 @@ function defaultOptions(context, compilerOptions, mode) {
|
|
|
111
111
|
providedExports: true,
|
|
112
112
|
usedExports: true,
|
|
113
113
|
mangleExports: true,
|
|
114
|
+
inlineExports: true,
|
|
114
115
|
// CHANGE: rspack does not support `emitOnErrors` yet.
|
|
115
116
|
emitOnErrors: true,
|
|
116
117
|
concatenateModules: !!testConfig?.optimization?.concatenateModules,
|
|
@@ -195,7 +196,6 @@ function defaultOptions(context, compilerOptions, mode) {
|
|
|
195
196
|
},
|
|
196
197
|
asyncWebAssembly: true,
|
|
197
198
|
topLevelAwait: true,
|
|
198
|
-
inlineConst: true,
|
|
199
199
|
// CHANGE: rspack does not support `backCompat` yet.
|
|
200
200
|
// backCompat: false,
|
|
201
201
|
// CHANGE: Rspack enables `css` by default.
|
|
@@ -36,6 +36,22 @@ self.importScripts = url => {
|
|
|
36
36
|
: "require(urlToPath(url))"};
|
|
37
37
|
};
|
|
38
38
|
self.fetch = async url => {
|
|
39
|
+
if (typeof url === "string" ? url.endsWith(".wasm") : url.toString().endsWith(".wasm")) {
|
|
40
|
+
return new Promise((resolve, reject) => {
|
|
41
|
+
fs.readFile(require("node:url").fileURLToPath(url), (err, data) => {
|
|
42
|
+
if (err) {
|
|
43
|
+
reject(err);
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
return resolve(
|
|
47
|
+
new Response(data, {
|
|
48
|
+
headers: { "Content-Type": "application/wasm" }
|
|
49
|
+
})
|
|
50
|
+
);
|
|
51
|
+
});
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
|
|
39
55
|
try {
|
|
40
56
|
const buffer = await new Promise((resolve, reject) =>
|
|
41
57
|
fs.readFile(urlToPath(url), (err, b) =>
|
|
@@ -43,7 +59,9 @@ self.fetch = async url => {
|
|
|
43
59
|
)
|
|
44
60
|
);
|
|
45
61
|
return {
|
|
46
|
-
headers: { get(name) {
|
|
62
|
+
headers: { get(name) {
|
|
63
|
+
if (name.toLowerCase() === "content-type") {}
|
|
64
|
+
} },
|
|
47
65
|
status: 200,
|
|
48
66
|
ok: true,
|
|
49
67
|
arrayBuffer() { return buffer; },
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rspack-canary/test-tools",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.7.0-canary-a0fc091c-20251217174017",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "Test tools for rspack",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -65,7 +65,7 @@
|
|
|
65
65
|
"@types/jsdom": "^21.1.7",
|
|
66
66
|
"typescript": "^5.9.3",
|
|
67
67
|
"wast-loader": "^1.14.1",
|
|
68
|
-
"@rspack/core": "npm:@rspack-canary/core@1.
|
|
68
|
+
"@rspack/core": "npm:@rspack-canary/core@1.7.0-canary-a0fc091c-20251217174017"
|
|
69
69
|
},
|
|
70
70
|
"peerDependencies": {
|
|
71
71
|
"@rspack/core": ">=1.0.0"
|