Ensure / is used for paths in import (#3411)

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
pull/3375/head^2
Hariom Balhara 2022-07-18 19:00:05 +05:30 committed by GitHub
parent 1b09b7efd4
commit a9ad9a6a39
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 2 deletions

View File

@ -103,7 +103,8 @@ function generateFiles() {
serverOutput.push(
...getObjectExporter("apiHandlers", {
fileToBeImported: "api/index.ts",
importBuilder: (app) => `const ${app.name}_api = import("./${app.path}/api");`,
// Import path must have / even for windows and not \
importBuilder: (app) => `const ${app.name}_api = import("./${app.path.replaceAll("\\", "/")}/api");`,
entryBuilder: (app) => `${app.name}:${app.name}_api,`,
})
);
@ -111,7 +112,9 @@ function generateFiles() {
browserOutput.push(
...getObjectExporter("appStoreMetadata", {
fileToBeImported: "_metadata.ts",
importBuilder: (app) => `import { metadata as ${app.name}_meta } from "./${app.path}/_metadata";`,
// Import path must have / even for windows and not \
importBuilder: (app) =>
`import { metadata as ${app.name}_meta } from "./${app.path.replaceAll("\\", "/")}/_metadata";`,
entryBuilder: (app) => `${app.name}:${app.name}_meta,`,
})
);