Skip to content

Commit 3edef53

Browse files
authored
Merge pull request #26 from subdavis/patch-3
Fix path resolution errors
2 parents 786f86b + 8c3e998 commit 3edef53

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/index.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ function vitePluginCesium(
2323
const cesiumBuildRootPath = 'node_modules/cesium/Build';
2424
const cesiumBuildPath = 'node_modules/cesium/Build/Cesium/';
2525

26-
let CESIUM_BASE_URL = '/cesium/';
26+
let CESIUM_BASE_URL = 'cesium/';
2727
let outDir = 'dist';
2828
let base: string = '/';
2929
let isBuild: boolean = false;
@@ -78,7 +78,7 @@ function vitePluginCesium(
7878

7979
configureServer({ middlewares }) {
8080
const cesiumPath = path.join(cesiumBuildRootPath, devMinifyCesium ? 'Cesium' : 'CesiumUnminified');
81-
middlewares.use(CESIUM_BASE_URL, serveStatic(cesiumPath));
81+
middlewares.use(path.join('/', CESIUM_BASE_URL), serveStatic(cesiumPath));
8282
},
8383

8484
async closeBundle() {
@@ -103,15 +103,15 @@ function vitePluginCesium(
103103
tag: 'link',
104104
attrs: {
105105
rel: 'stylesheet',
106-
href: base + normalizePath(path.join(CESIUM_BASE_URL, 'Widgets/widgets.css'))
106+
href: normalizePath(path.join(CESIUM_BASE_URL, 'Widgets/widgets.css')),
107107
}
108108
}
109109
];
110110
if (isBuild && !rebuildCesium) {
111111
tags.push({
112112
tag: 'script',
113113
attrs: {
114-
src: base + normalizePath(path.join(CESIUM_BASE_URL, 'Cesium.js'))
114+
src: normalizePath(path.join(CESIUM_BASE_URL, 'Cesium.js')),
115115
}
116116
});
117117
}

0 commit comments

Comments
 (0)