mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
ui: fix build on windows
This commit is contained in:
1 parent
ee4fc2b732
commit
c008639242
1 file changed
+2
-2
@@ -95,7 +95,7 @@ export async function buildUI() {
|
|||||||
}
|
}
|
||||||
for (const m of lazyModules) {
|
for (const m of lazyModules) {
|
||||||
const name = basename(m).split('.')[0];
|
const name = basename(m).split('.')[0];
|
||||||
const { outputFiles } = await build(`window.lazyModuleResolver['${name}'](require('${relative(tmp, m)}'))`);
|
const { outputFiles } = await build(`window.lazyModuleResolver['${name}'](require('${relative(tmp, m).replace(/\\/g, '\\\\')}'))`);
|
||||||
for (const file of outputFiles) {
|
for (const file of outputFiles) {
|
||||||
addFile(basename(m).replace(/\.[tj]sx?$/, '.js'), file.text);
|
addFile(basename(m).replace(/\.[tj]sx?$/, '.js'), file.text);
|
||||||
}
|
}
|
||||||
@@ -107,7 +107,7 @@ export async function buildUI() {
|
|||||||
}
|
}
|
||||||
const entry = await build([
|
const entry = await build([
|
||||||
`window.lazyloadMetadata = ${JSON.stringify(hashes)};`,
|
`window.lazyloadMetadata = ${JSON.stringify(hashes)};`,
|
||||||
...entryPoints.map((i) => `import '${relative(tmp, i)}';`),
|
...entryPoints.map((i) => `import '${relative(tmp, i).replace(/\\/g, '\\\\')}';`),
|
||||||
].join('\n'));
|
].join('\n'));
|
||||||
const pages = entry.outputFiles.map((i) => i.text);
|
const pages = entry.outputFiles.map((i) => i.text);
|
||||||
const str = `window.LANGS=${JSON.stringify(SettingModel.langs)};${pages.join('\n')}`;
|
const str = `window.LANGS=${JSON.stringify(SettingModel.langs)};${pages.join('\n')}`;
|
||||||
|
|||||||
Reference in new issue
Block a user