@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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rspack/binding-wasm32-wasi",
3
- "version": "2.0.0-rc.0",
3
+ "version": "2.0.0-rc.1",
4
4
  "license": "MIT",
5
5
  "description": "Node binding for rspack",
6
6
  "main": "rspack.wasi.cjs",
package/rspack.wasi.cjs CHANGED
@@ -32,12 +32,13 @@ const __sharedMemory = new WebAssembly.Memory({
32
32
  shared: true,
33
33
  })
34
34
 
35
- let __wasmFilePath = __nodePath.join(__dirname, 'rspack.wasm32-wasi.wasm')
36
- const __wasmDebugFilePath = __nodePath.join(__dirname, 'rspack.wasm32-wasi.debug.wasm')
35
+ const localWasmFilePath = __nodePath.join(__dirname, 'rspack.wasm32-wasi.wasm')
37
36
 
38
- if (__nodeFs.existsSync(__wasmDebugFilePath)) {
39
- __wasmFilePath = __wasmDebugFilePath
40
- } else if (!__nodeFs.existsSync(__wasmFilePath)) {
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();
Binary file