1
0
Code Issues Pull Requests Packages Projects Releases Wiki Activity GitHub Gitee

fix: build.outDir is relative to root in vite

This commit is contained in:
nshen
2021-09-17 18:55:47 +08:00
parent b117e09799
commit 7589c81a4c

View File

@@ -33,7 +33,6 @@ function vitePluginCesium(
config(c, { command }) { config(c, { command }) {
isBuild = command === 'build'; isBuild = command === 'build';
if (c.build?.outDir) outDir = c.build.outDir;
if (c.base) { if (c.base) {
base = c.base; base = c.base;
} }
@@ -56,6 +55,10 @@ function vitePluginCesium(
return userConfig; return userConfig;
}, },
configResolved(resolvedConfig) {
outDir = path.join(resolvedConfig.root, resolvedConfig.build.outDir);
},
async load(id: string) { async load(id: string) {
if (!rebuildCesium) return null; if (!rebuildCesium) return null;
// replace CESIUM_BASE_URL variable in 'cesium/Source/Core/buildModuleUrl.js' // replace CESIUM_BASE_URL variable in 'cesium/Source/Core/buildModuleUrl.js'