@swc/minifier 1.13.5-nightly-20250824.1 → 1.13.15-nightly-20250924.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.
Files changed (3) hide show
  1. package/binding.js +11 -5
  2. package/package.json +14 -14
  3. package/src/binding.js +11 -5
package/binding.js CHANGED
@@ -390,11 +390,17 @@ if (!nativeBinding || process.env.NAPI_RS_FORCE_WASI) {
390
390
  }
391
391
  if (!nativeBinding) {
392
392
  if (loadErrors.length > 0) {
393
- // TODO Link to documentation with potential fixes
394
- // - The package owner could build/publish bindings for this arch
395
- // - The user may need to bundle the correct files
396
- // - The user may need to re-install node_modules to get new packages
397
- throw new Error('Failed to load native binding', { cause: loadErrors });
393
+ // Provide actionable guidance and a documentation link for troubleshooting.
394
+ // Keep message construction simple to avoid any runtime overhead unless an error occurs.
395
+ const help = [
396
+ `Failed to load native binding for @swc/minifier on ${process.platform}-${process.arch}.`,
397
+ `See https://swc.rs/docs/installation for troubleshooting and potential fixes:`,
398
+ ` - Package owner may need to publish prebuilt bindings for this platform/arch`,
399
+ ` - Ensure the correct optional @swc/minifier-* binary package is installed/bundled`,
400
+ ` - Reinstall dependencies (for example, remove lockfile and node_modules, then reinstall)`,
401
+ `If the issue persists, please open an issue: https://github.com/swc-project/swc/issues`
402
+ ].join("\n");
403
+ throw new Error(help, { cause: loadErrors });
398
404
  }
399
405
  throw new Error(`Failed to load native binding`);
400
406
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@swc/minifier",
3
- "version": "1.13.5-nightly-20250824.1",
3
+ "version": "1.13.15-nightly-20250924.1",
4
4
  "description": "Super-fast alternative for terser",
5
5
  "homepage": "https://swc.rs",
6
6
  "main": "./index.js",
@@ -43,7 +43,7 @@
43
43
  "types": "./index.d.ts",
44
44
  "scripts": {
45
45
  "artifacts": "napi artifacts --npm-dir scripts/npm",
46
- "prepack": "tsc -d && napi prepublish -p scripts/npm --tag-style npm",
46
+ "prepack": "tsc -d && napi prepublish -p scripts/npm --tag-style npm --skip-optional-publish",
47
47
  "pack": "wasm-pack",
48
48
  "build:ts": "tsc -d",
49
49
  "build:wasm": "npm-run-all \"pack -- build ../../bindings/binding_minifier_wasm --scope swc {1} -t {2}\" --",
@@ -58,24 +58,24 @@
58
58
  },
59
59
  "dependencies": {
60
60
  "@swc/counter": "^0.1.3",
61
- "@swc/types": "^0.1.24"
61
+ "@swc/types": "^0.1.25"
62
62
  },
63
63
  "devDependencies": {
64
- "@napi-rs/cli": "^3.0.0-alpha.22",
64
+ "@napi-rs/cli": "^3.2.0",
65
65
  "@types/node": "^20.7.1",
66
66
  "cross-env": "^7.0.3",
67
67
  "typescript": "^5.2.2"
68
68
  },
69
69
  "optionalDependencies": {
70
- "@swc/minifier-darwin-x64": "1.13.5-nightly-20250824.1",
71
- "@swc/minifier-win32-x64-msvc": "1.13.5-nightly-20250824.1",
72
- "@swc/minifier-linux-x64-gnu": "1.13.5-nightly-20250824.1",
73
- "@swc/minifier-linux-x64-musl": "1.13.5-nightly-20250824.1",
74
- "@swc/minifier-win32-ia32-msvc": "1.13.5-nightly-20250824.1",
75
- "@swc/minifier-linux-arm-gnueabihf": "1.13.5-nightly-20250824.1",
76
- "@swc/minifier-linux-arm64-gnu": "1.13.5-nightly-20250824.1",
77
- "@swc/minifier-darwin-arm64": "1.13.5-nightly-20250824.1",
78
- "@swc/minifier-linux-arm64-musl": "1.13.5-nightly-20250824.1",
79
- "@swc/minifier-win32-arm64-msvc": "1.13.5-nightly-20250824.1"
70
+ "@swc/minifier-darwin-x64": "1.13.15-nightly-20250924.1",
71
+ "@swc/minifier-win32-x64-msvc": "1.13.15-nightly-20250924.1",
72
+ "@swc/minifier-linux-x64-gnu": "1.13.15-nightly-20250924.1",
73
+ "@swc/minifier-linux-x64-musl": "1.13.15-nightly-20250924.1",
74
+ "@swc/minifier-win32-ia32-msvc": "1.13.15-nightly-20250924.1",
75
+ "@swc/minifier-linux-arm-gnueabihf": "1.13.15-nightly-20250924.1",
76
+ "@swc/minifier-linux-arm64-gnu": "1.13.15-nightly-20250924.1",
77
+ "@swc/minifier-darwin-arm64": "1.13.15-nightly-20250924.1",
78
+ "@swc/minifier-linux-arm64-musl": "1.13.15-nightly-20250924.1",
79
+ "@swc/minifier-win32-arm64-msvc": "1.13.15-nightly-20250924.1"
80
80
  }
81
81
  }
package/src/binding.js CHANGED
@@ -352,11 +352,17 @@ if (!nativeBinding || process.env.NAPI_RS_FORCE_WASI) {
352
352
 
353
353
  if (!nativeBinding) {
354
354
  if (loadErrors.length > 0) {
355
- // TODO Link to documentation with potential fixes
356
- // - The package owner could build/publish bindings for this arch
357
- // - The user may need to bundle the correct files
358
- // - The user may need to re-install node_modules to get new packages
359
- throw new Error('Failed to load native binding', { cause: loadErrors })
355
+ // Provide actionable guidance and a documentation link for troubleshooting.
356
+ // Keep message construction simple to avoid any runtime overhead unless an error occurs.
357
+ const help = [
358
+ `Failed to load native binding for @swc/minifier on ${process.platform}-${process.arch}.`,
359
+ `See https://swc.rs/docs/installation for troubleshooting and potential fixes:`,
360
+ ` - Package owner may need to publish prebuilt bindings for this platform/arch`,
361
+ ` - Ensure the correct optional @swc/minifier-* binary package is installed/bundled`,
362
+ ` - Reinstall dependencies (for example, remove lockfile and node_modules, then reinstall)`,
363
+ `If the issue persists, please open an issue: https://github.com/swc-project/swc/issues`
364
+ ].join("\n")
365
+ throw new Error(help, { cause: loadErrors })
360
366
  }
361
367
  throw new Error(`Failed to load native binding`)
362
368
  }