diff --git a/package.json b/package.json index 62a3153..d3d2a53 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "vite-plugin-cesium", - "version": "1.2.7", + "version": "1.2.9", "description": "Cesium library plugin for Vite", "main": "dist/index.js", "types": "dist/index.d.ts", diff --git a/src/index.ts b/src/index.ts index 71da6b8..a13f074 100644 --- a/src/index.ts +++ b/src/index.ts @@ -2,7 +2,7 @@ import fs from 'fs-extra'; import path from 'path'; import externalGlobals from 'rollup-plugin-external-globals'; import serveStatic from 'serve-static'; -import { HtmlTagDescriptor, Plugin, UserConfig } from 'vite'; +import { HtmlTagDescriptor, normalizePath, Plugin, UserConfig } from 'vite'; interface VitePluginCesiumOptions { /** @@ -116,14 +116,16 @@ function vitePluginCesium( tag: 'link', attrs: { rel: 'stylesheet', - href: path.join(CESIUM_BASE_URL, 'Widgets/widgets.css') + href: normalizePath( + path.join(CESIUM_BASE_URL, 'Widgets/widgets.css') + ) } } ]; if (isBuild && !rebuildCesium) { tags.push({ tag: 'script', - attrs: { src: path.join(base, 'cesium/Cesium.js') } + attrs: { src: normalizePath(path.join(base, 'cesium/Cesium.js')) } }); } return tags;