Fix build for windows

This commit is contained in:
garronej 2024-10-24 16:56:13 +00:00
parent babbe39494
commit 3fc2108214

View File

@ -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',`,
` },`,