@pkgr/core 0.2.4 → 0.2.5
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/lib/constants.js +4 -1
- package/lib/constants.js.map +1 -1
- package/lib/index.cjs +2 -1
- package/package.json +1 -1
package/lib/constants.js
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { createRequire } from 'node:module';
|
|
2
2
|
export const CWD = process.cwd();
|
|
3
|
-
|
|
3
|
+
const importMetaUrl = import.meta.url;
|
|
4
|
+
export const cjsRequire = importMetaUrl
|
|
5
|
+
? createRequire(importMetaUrl)
|
|
6
|
+
: require;
|
|
4
7
|
export const EVAL_FILENAMES = new Set(['[eval]', '[worker eval]']);
|
|
5
8
|
export const EXTENSIONS = ['.ts', '.tsx', ...Object.keys(cjsRequire.extensions)];
|
|
6
9
|
//# sourceMappingURL=constants.js.map
|
package/lib/constants.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAE3C,MAAM,CAAC,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,EAAE,CAAA;AAMhC,MAAM,
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAE3C,MAAM,CAAC,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,EAAE,CAAA;AAMhC,MAAM,aAAa,GAAG,MAAM,CAAC,IAAI,CAAC,GAAG,CAAA;AAErC,MAAM,CAAC,MAAM,UAAU,GAAe,aAAa;IACjD,CAAC,CAAC,aAAa,CAAC,aAAa,CAAC;IAC9B,CAAC,CAAC,OAAO,CAAA;AAEX,MAAM,CAAC,MAAM,cAAc,GAAG,IAAI,GAAG,CAAC,CAAC,QAAQ,EAAE,eAAe,CAAC,CAAC,CAAA;AAGlE,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC,CAAA"}
|
package/lib/index.cjs
CHANGED
|
@@ -6,7 +6,8 @@ var path = require('node:path');
|
|
|
6
6
|
|
|
7
7
|
const import_meta = {};
|
|
8
8
|
const CWD = process.cwd();
|
|
9
|
-
const
|
|
9
|
+
const importMetaUrl = import_meta.url;
|
|
10
|
+
const cjsRequire = importMetaUrl ? node_module.createRequire(importMetaUrl) : require;
|
|
10
11
|
const EVAL_FILENAMES = /* @__PURE__ */ new Set(["[eval]", "[worker eval]"]);
|
|
11
12
|
const EXTENSIONS = [".ts", ".tsx", ...Object.keys(cjsRequire.extensions)];
|
|
12
13
|
|