1.0.10
This commit is contained in:
parent
31631bf4c6
commit
5702d7c7fb
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "vite-plugin-ice-mars3d",
|
||||
"version": "1.0.9",
|
||||
"version": "1.0.10",
|
||||
"description": "mars3d library plugin for Vite",
|
||||
"main": "dist/index.js",
|
||||
"types": "dist/index.d.ts",
|
||||
|
|
31
src/index.ts
31
src/index.ts
|
@ -91,24 +91,24 @@ function vitePluginCesium(
|
|||
try {
|
||||
await fs.copy(
|
||||
path.join(cesiumBuildPath, 'Assets'),
|
||||
path.join(outDir, 'mars3d-cesium/Assets')
|
||||
path.join(outDir, 'Cesium/Assets')
|
||||
);
|
||||
await fs.copy(
|
||||
path.join(cesiumBuildPath, 'ThirdParty'),
|
||||
path.join(outDir, 'mars3d-cesium/ThirdParty')
|
||||
path.join(outDir, 'Cesium/ThirdParty')
|
||||
);
|
||||
await fs.copy(
|
||||
path.join(cesiumBuildPath, 'Workers'),
|
||||
path.join(outDir, 'mars3d-cesium/Workers')
|
||||
path.join(outDir, 'Cesium/Workers')
|
||||
);
|
||||
await fs.copy(
|
||||
path.join(cesiumBuildPath, 'Widgets'),
|
||||
path.join(outDir, 'mars3d-cesium/Widgets')
|
||||
path.join(outDir, 'Cesium/Widgets')
|
||||
);
|
||||
if (!rebuildCesium) {
|
||||
await fs.copy(
|
||||
path.join(cesiumBuildPath, 'Cesium.js'),
|
||||
path.join(outDir, 'mars3d-cesium/Cesium.js')
|
||||
path.join(outDir, 'Cesium/Cesium.js')
|
||||
);
|
||||
}
|
||||
await fs.copy(
|
||||
|
@ -122,13 +122,20 @@ function vitePluginCesium(
|
|||
},
|
||||
|
||||
transformIndexHtml() {
|
||||
const tags: HtmlTagDescriptor[] = [
|
||||
{
|
||||
const tags: HtmlTagDescriptor[] = [];
|
||||
if (isBuild && !rebuildCesium) {
|
||||
tags.push({
|
||||
tag: 'script',
|
||||
attrs: { src: normalizePath(path.join(base, 'Cesium/Cesium.js')) }
|
||||
});
|
||||
}
|
||||
if (isBuild) {
|
||||
tags.push( {
|
||||
tag: 'link',
|
||||
attrs: {
|
||||
rel: 'stylesheet',
|
||||
href: normalizePath(
|
||||
path.join(CESIUM_BASE_URL, 'Widgets/widgets.css')
|
||||
path.join('/Cesium/', 'Widgets/widgets.css')
|
||||
)
|
||||
}
|
||||
},
|
||||
|
@ -140,15 +147,7 @@ function vitePluginCesium(
|
|||
path.join(MARS3D_BASE_URL, 'mars3d.css')
|
||||
)
|
||||
}
|
||||
}
|
||||
];
|
||||
if (isBuild && !rebuildCesium) {
|
||||
tags.push({
|
||||
tag: 'script',
|
||||
attrs: { src: normalizePath(path.join(base, 'mars3d-cesium/Cesium.js')) }
|
||||
});
|
||||
}
|
||||
if (isBuild) {
|
||||
tags.push({
|
||||
tag: 'script',
|
||||
attrs: { src: normalizePath(path.join(MARS3D_BASE_URL, 'mars3d.js')) }
|
||||
|
|
Loading…
Reference in New Issue