Skip to content

Commit

Permalink
Merge pull request #47 from an501920078/patch-1
Browse files Browse the repository at this point in the history
Update index.ts
  • Loading branch information
nshen authored Nov 1, 2023
2 parents 3fb46a5 + 22407b0 commit 3eefe02
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,11 @@ export default function vitePluginCesium(options: VitePluginCesiumOptions = {}):

configureServer({ middlewares }) {
const cesiumPath = path.join(cesiumBuildRootPath, devMinifyCesium ? 'Cesium' : 'CesiumUnminified');
middlewares.use(path.posix.join('/', CESIUM_BASE_URL), serveStatic(cesiumPath));
middlewares.use(path.posix.join('/', CESIUM_BASE_URL), serveStatic(cesiumPath, {
setHeaders: (res, path, stat) => {
res.setHeader('Access-Control-Allow-Origin', '*')
}
}));
},

async closeBundle() {
Expand Down

0 comments on commit 3eefe02

Please sign in to comment.