@embeddable.com/sdk-core 3.2.0-next.7 → 3.2.0-next.9
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.
|
@@ -33,9 +33,9 @@ const NON_JS_TS_EXTENSIONS =
|
|
|
33
33
|
|
|
34
34
|
const currentDir = dirname(fileURLToPath(import.meta.url));
|
|
35
35
|
|
|
36
|
-
|
|
37
|
-
const isWindows = process.platform === "win32";
|
|
36
|
+
const isWindows = process.platform === "win32";
|
|
38
37
|
|
|
38
|
+
export const resolve = async (specifier, context, nextResolve) => {
|
|
39
39
|
if (NON_JS_TS_EXTENSIONS.test(specifier)) {
|
|
40
40
|
const mockModulePath = pathToFileURL(
|
|
41
41
|
join(currentDir, "mock-module.js"),
|
|
@@ -135,6 +135,9 @@ export const load = async (url, context, nextLoad) => {
|
|
|
135
135
|
shortCircuit: true,
|
|
136
136
|
};
|
|
137
137
|
} else {
|
|
138
|
+
if (isWindows && !url.startsWith("file://") && url.includes("node_modules")) {
|
|
139
|
+
return nextLoad(pathToFileURL(url).href, context);
|
|
140
|
+
}
|
|
138
141
|
return nextLoad(url, context);
|
|
139
142
|
}
|
|
140
143
|
};
|
package/package.json
CHANGED
package/src/entryPoint.ts
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import path from "node:path";
|
|
2
|
-
import { fileURLToPath } from "node:url";
|
|
2
|
+
import { fileURLToPath, pathToFileURL } from "node:url";
|
|
3
3
|
|
|
4
4
|
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
5
|
-
const COMMANDS_MAP = await import(
|
|
5
|
+
const COMMANDS_MAP = await import(
|
|
6
|
+
pathToFileURL(path.join(__dirname, "../lib/index.js")).href
|
|
7
|
+
);
|
|
6
8
|
|
|
7
9
|
async function main() {
|
|
8
10
|
const command = process.argv[2];
|