From 3fc2108214341e58165619ef2db74223a5b112f9 Mon Sep 17 00:00:00 2001 From: garronej Date: Thu, 24 Oct 2024 16:56:13 +0000 Subject: [PATCH] Fix build for windows --- scripts/build/vendorFrontendDependencies.ts | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/scripts/build/vendorFrontendDependencies.ts b/scripts/build/vendorFrontendDependencies.ts index c03e99a2..eb277bde 100644 --- a/scripts/build/vendorFrontendDependencies.ts +++ b/scripts/build/vendorFrontendDependencies.ts @@ -3,7 +3,8 @@ import { join as pathJoin, relative as pathRelative, basename as pathBasename, - dirname as pathDirname + dirname as pathDirname, + sep as pathSep } from "path"; import { assert } from "tsafe/assert"; import { run } from "../shared/run"; @@ -45,9 +46,21 @@ export function vendorFrontendDependencies(params: { distDirPath: string }) { ``, `module.exports = {`, ` mode: 'production',`, - ` entry: '${filePath}',`, + ` entry: path.join(...[__dirname, ${pathRelative( + pathDirname(webpackConfigJsFilePath), + filePath + ) + .split(pathSep) + .map(segment => `"${segment}"`) + .join(", ")}]),`, ` output: {`, - ` path: '${webpackOutputDirPath}',`, + ` path: path.join(...[__dirname, ${pathRelative( + pathDirname(webpackConfigJsFilePath), + webpackOutputDirPath + ) + .split(pathSep) + .map(segment => `"${segment}"`) + .join(", ")}]),`, ` filename: '${pathBasename(webpackOutputFilePath)}',`, ` libraryTarget: 'module',`, ` },`,