Skip to content

Commit

Permalink
Fix getExtensionPageUrl on Windows (#1609)
Browse files Browse the repository at this point in the history
* Fix getExtensionPageUrl on Windows

Signed-off-by: Lauri Nevala <[email protected]>

* Use path.posix.join() instead

Signed-off-by: Lauri Nevala <[email protected]>

* Fix lint issues

Signed-off-by: Lauri Nevala <[email protected]>
  • Loading branch information
nevalla authored Dec 2, 2020
1 parent c22d569 commit 57d6dfa
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/extensions/registries/page-registry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export function getExtensionPageUrl<P extends object>({ 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
Expand Down
1 change: 1 addition & 0 deletions webpack.extensions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 <https://webpack.js.org/configuration/target/>
Expand Down
1 change: 1 addition & 0 deletions webpack.main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
1 change: 1 addition & 0 deletions webpack.renderer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ export function webpackLensRenderer({ showVars = true } = {}): webpack.Configura
if (showVars) {
console.info("WEBPACK:renderer", vars);
}

return {
context: __dirname,
target: "electron-renderer",
Expand Down

0 comments on commit 57d6dfa

Please sign in to comment.