@salty-css/core 0.0.1-alpha.326 → 0.0.1-alpha.327
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/compiler/helpers.cjs +4 -1
- package/compiler/helpers.js +4 -1
- package/package.json +1 -1
package/compiler/helpers.cjs
CHANGED
|
@@ -5,7 +5,10 @@ var _documentCurrentScript = typeof document !== "undefined" ? document.currentS
|
|
|
5
5
|
const getCorePackageRoot = () => {
|
|
6
6
|
try {
|
|
7
7
|
console.log("getCorePackageRoot import.meta.url:", typeof document === "undefined" ? require("url").pathToFileURL(__filename).href : _documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === "SCRIPT" && _documentCurrentScript.src || new URL("compiler/helpers.cjs", document.baseURI).href);
|
|
8
|
-
|
|
8
|
+
console.log("getCorePackageRoot process.cwd():", process.cwd());
|
|
9
|
+
const currentDir = (typeof document === "undefined" ? require("url").pathToFileURL(__filename).href : _documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === "SCRIPT" && _documentCurrentScript.src || new URL("compiler/helpers.cjs", document.baseURI).href) || process.cwd();
|
|
10
|
+
console.log("getCorePackageRoot currentDir:", currentDir);
|
|
11
|
+
let { pathname } = new URL(currentDir);
|
|
9
12
|
console.log("getCorePackageRoot pathname start:", pathname);
|
|
10
13
|
while (/core\/?(src\/)?$/.test(pathname) === false) {
|
|
11
14
|
pathname = path.join(pathname, "../");
|
package/compiler/helpers.js
CHANGED
|
@@ -2,7 +2,10 @@ import { join } from "path";
|
|
|
2
2
|
const getCorePackageRoot = () => {
|
|
3
3
|
try {
|
|
4
4
|
console.log("getCorePackageRoot import.meta.url:", import.meta.url);
|
|
5
|
-
|
|
5
|
+
console.log("getCorePackageRoot process.cwd():", process.cwd());
|
|
6
|
+
const currentDir = import.meta.url || process.cwd();
|
|
7
|
+
console.log("getCorePackageRoot currentDir:", currentDir);
|
|
8
|
+
let { pathname } = new URL(currentDir);
|
|
6
9
|
console.log("getCorePackageRoot pathname start:", pathname);
|
|
7
10
|
while (/core\/?(src\/)?$/.test(pathname) === false) {
|
|
8
11
|
pathname = join(pathname, "../");
|