Use nodeJS 14+ compatible method for replacing (#3429)

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

View File

@ -104,7 +104,7 @@ function generateFiles() {
...getObjectExporter("apiHandlers", {
fileToBeImported: "api/index.ts",
// Import path must have / even for windows and not \
importBuilder: (app) => `const ${app.name}_api = import("./${app.path.replaceAll("\\", "/")}/api");`,
importBuilder: (app) => `const ${app.name}_api = import("./${app.path.replace(/\\/g, "/")}/api");`,
entryBuilder: (app) => `${app.name}:${app.name}_api,`,
})
);
@ -114,7 +114,7 @@ function generateFiles() {
fileToBeImported: "_metadata.ts",
// Import path must have / even for windows and not \
importBuilder: (app) =>
`import { metadata as ${app.name}_meta } from "./${app.path.replaceAll("\\", "/")}/_metadata";`,
`import { metadata as ${app.name}_meta } from "./${app.path.replace(/\\/g, "/")}/_metadata";`,
entryBuilder: (app) => `${app.name}:${app.name}_meta,`,
})
);