rolldown-require 2.0.10 → 2.0.12

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 (2) hide show
  1. package/dist/index.mjs +5 -1
  2. package/package.json +2 -2
package/dist/index.mjs CHANGED
@@ -32,7 +32,11 @@ function collectReferencedModules(bundle, fileName, allModules, analyzedModules
32
32
  }
33
33
  //#endregion
34
34
  //#region src/constants.ts
35
- const { version } = JSON.parse(readFileSync(new URL("../package.json", import.meta.url)).toString());
35
+ const BOM_RE = /^\uFEFF/;
36
+ function stripBom(value) {
37
+ return value.replace(BOM_RE, "");
38
+ }
39
+ const { version } = JSON.parse(stripBom(readFileSync(new URL("../package.json", import.meta.url), "utf8")));
36
40
  if (process.versions.pnp) try {
37
41
  createRequire(import.meta.url)("pnpapi");
38
42
  } catch {}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "rolldown-require",
3
3
  "type": "module",
4
- "version": "2.0.10",
4
+ "version": "2.0.12",
5
5
  "description": "bundle and require a file using rolldown!",
6
6
  "author": "ice breaker <1324318532@qq.com>",
7
7
  "license": "MIT",
@@ -48,7 +48,7 @@
48
48
  "node": "^20.19.0 || >=22.12.0"
49
49
  },
50
50
  "peerDependencies": {
51
- "rolldown": "1.0.0-rc.12"
51
+ "rolldown": "1.0.0-rc.11"
52
52
  },
53
53
  "dependencies": {
54
54
  "@rollup/pluginutils": "^5.3.0",