From 57d6dfa4b060ccbeceaac65bfc789b78d3db1656 Mon Sep 17 00:00:00 2001 From: Lauri Nevala Date: Wed, 2 Dec 2020 13:09:47 +0200 Subject: [PATCH] Fix getExtensionPageUrl on Windows (#1609) * Fix getExtensionPageUrl on Windows Signed-off-by: Lauri Nevala * Use path.posix.join() instead Signed-off-by: Lauri Nevala * Fix lint issues Signed-off-by: Lauri Nevala --- src/extensions/registries/page-registry.ts | 2 +- webpack.extensions.ts | 1 + webpack.main.ts | 1 + webpack.renderer.ts | 1 + 4 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/extensions/registries/page-registry.ts b/src/extensions/registries/page-registry.ts index 188a6aa8b3d4..591dcba8367c 100644 --- a/src/extensions/registries/page-registry.ts +++ b/src/extensions/registries/page-registry.ts @@ -44,7 +44,7 @@ export function getExtensionPageUrl

({ extensionId, pageId = "" const extensionBaseUrl = compile(`/extension/:name`)({ name: sanitizeExtensionName(extensionId), // compile only with extension-id first and define base path }); - const extPageRoutePath = path.join(extensionBaseUrl, pageId); // page-id might contain route :param-s, so don't compile yet + const extPageRoutePath = path.posix.join(extensionBaseUrl, pageId); if (params) { return compile(extPageRoutePath)(params); // might throw error when required params not passed diff --git a/webpack.extensions.ts b/webpack.extensions.ts index b88dfde7ebb0..0c2829a4062c 100644 --- a/webpack.extensions.ts +++ b/webpack.extensions.ts @@ -6,6 +6,7 @@ import { sassCommonVars } from "./src/common/vars"; export default function (): webpack.Configuration { const entry = "./src/extensions/extension-api.ts"; const outDir = "./src/extensions/npm/extensions/dist"; + return { // Compile for Electron for renderer process // see diff --git a/webpack.main.ts b/webpack.main.ts index 8d83d2b75d01..6972c92457fb 100755 --- a/webpack.main.ts +++ b/webpack.main.ts @@ -8,6 +8,7 @@ import * as vars from "./src/common/vars"; export default function (): webpack.Configuration { console.info("WEBPACK:main", vars); + return { context: __dirname, target: "electron-main", diff --git a/webpack.renderer.ts b/webpack.renderer.ts index f788ff40c395..441944a2c82e 100755 --- a/webpack.renderer.ts +++ b/webpack.renderer.ts @@ -17,6 +17,7 @@ export function webpackLensRenderer({ showVars = true } = {}): webpack.Configura if (showVars) { console.info("WEBPACK:renderer", vars); } + return { context: __dirname, target: "electron-renderer",