@rspack/binding-wasm32-wasi 2.0.0-rc.0 → 2.0.0-rc.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.
- package/package.json +1 -1
- package/rspack.wasi.cjs +9 -8
- package/rspack.wasm32-wasi.wasm +0 -0
package/package.json
CHANGED
package/rspack.wasi.cjs
CHANGED
|
@@ -32,12 +32,13 @@ const __sharedMemory = new WebAssembly.Memory({
|
|
|
32
32
|
shared: true,
|
|
33
33
|
})
|
|
34
34
|
|
|
35
|
-
|
|
36
|
-
const __wasmDebugFilePath = __nodePath.join(__dirname, 'rspack.wasm32-wasi.debug.wasm')
|
|
35
|
+
const localWasmFilePath = __nodePath.join(__dirname, 'rspack.wasm32-wasi.wasm')
|
|
37
36
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
37
|
+
let __wasmFilePath;
|
|
38
|
+
|
|
39
|
+
if (__nodeFs.existsSync(localWasmFilePath)) {
|
|
40
|
+
__wasmFilePath = localWasmFilePath
|
|
41
|
+
} else {
|
|
41
42
|
try {
|
|
42
43
|
__wasmFilePath = require.resolve('@rspack/binding-wasm32-wasi/rspack.wasm32-wasi.wasm')
|
|
43
44
|
} catch {
|
|
@@ -47,7 +48,7 @@ if (__nodeFs.existsSync(__wasmDebugFilePath)) {
|
|
|
47
48
|
|
|
48
49
|
const { instance: __napiInstance, module: __wasiModule, napiModule: __napiModule } = __emnapiInstantiateNapiModuleSync(__nodeFs.readFileSync(__wasmFilePath), {
|
|
49
50
|
context: __emnapiContext,
|
|
50
|
-
asyncWorkPoolSize: (function() {
|
|
51
|
+
asyncWorkPoolSize: (function () {
|
|
51
52
|
const threadsSizeFromEnv = Number(process.env.NAPI_RS_ASYNC_WORK_POOL_SIZE ?? process.env.UV_THREADPOOL_SIZE)
|
|
52
53
|
// NaN > 0 is false
|
|
53
54
|
if (threadsSizeFromEnv > 0) {
|
|
@@ -76,14 +77,14 @@ const { instance: __napiInstance, module: __wasiModule, napiModule: __napiModule
|
|
|
76
77
|
s.toString().includes("kPublicPort")
|
|
77
78
|
);
|
|
78
79
|
if (kPublicPort) {
|
|
79
|
-
worker[kPublicPort].ref = () => {};
|
|
80
|
+
worker[kPublicPort].ref = () => { };
|
|
80
81
|
}
|
|
81
82
|
|
|
82
83
|
const kHandle = Object.getOwnPropertySymbols(worker).find(s =>
|
|
83
84
|
s.toString().includes("kHandle")
|
|
84
85
|
);
|
|
85
86
|
if (kHandle) {
|
|
86
|
-
worker[kHandle].ref = () => {};
|
|
87
|
+
worker[kHandle].ref = () => { };
|
|
87
88
|
}
|
|
88
89
|
|
|
89
90
|
worker.unref();
|
package/rspack.wasm32-wasi.wasm
CHANGED
|
Binary file
|