Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

outDir不合理,导致无法找到cesium.js文件。 #56

Open
songhuige opened this issue Sep 6, 2024 · 13 comments
Open

outDir不合理,导致无法找到cesium.js文件。 #56

songhuige opened this issue Sep 6, 2024 · 13 comments

Comments

@songhuige
Copy link

songhuige commented Sep 6, 2024

####vite配置:

export default defineConfig({
  base: "/analysis",
  plugins: [vue(), vueJsx(), cesium()],
});

错误输出路径

|-- dist
|-- favicon.ico
|-- index.html
|-- jquery.min.js
|-- nginx.conf
|-- analysis
|-- |-- cesium
|-- |--|-- Cesium.js

预期输出路径

|-- dist
|-- favicon.ico
|-- index.html
|-- jquery.min.js
|-- nginx.conf
|-- cesium
|--|-- Cesium.js

@itfsw
Copy link

itfsw commented Sep 7, 2024

遇到了同样问题

@itfsw
Copy link

itfsw commented Sep 7, 2024

找到解决办法了,固定插件版本:1.2.22,新版本引入了cesiumBaseUrl 导致的

@nshen
Copy link
Owner

nshen commented Sep 7, 2024

我看了一下 1.2.23 默认 cesiumBaseUrl 也是和1.2.22一样的呀,为什么会出问题呢?
85e4c55

找到解决办法了,固定插件版本:1.2.22,新版本引入了cesiumBaseUrl 导致的

@hqzqaq
Copy link

hqzqaq commented Sep 12, 2024

找到解决办法了,固定插件版本:1.2.22,新版本引入了cesiumBaseUrl 导致的

我就是在1.2.22版本出现的这个问题,无法解决。

@hqzqaq
Copy link

hqzqaq commented Sep 21, 2024

找到解决办法了,固定插件版本:1.2.22,新版本引入了cesiumBaseUrl 导致的

我就是在1.2.22版本出现的这个问题,无法解决。

我通过修改源码解决了

@nshen
Copy link
Owner

nshen commented Sep 23, 2024

我通过修改源码解决了

是哪里的问题呢

@hqzqaq
Copy link

hqzqaq commented Sep 23, 2024

我通过修改源码解决了

是哪里的问题呢

modify
直接修改的node_modules中的源码,应该还有更好的方式吧,我用的粗暴的

@jak983464779
Copy link

image
这里加上base好像就可以了

@Zhliyun
Copy link

Zhliyun commented Oct 21, 2024

我通过修改源码解决了

是哪里的问题呢

我排查了一下,问题出在 outDir 拼接时没有考虑 vite 配置中可能带来绝对路径问题,将 path.join 替换成 path.resolve 即可

@WebRookie
Copy link

我通过修改源码解决了

是哪里的问题呢

我排查了一下,问题出在 outDir 拼接时没有考虑 vite 配置中可能带来绝对路径问题,将 path.join 替换成 path.resolve 即可

具体是哪里呢

@JORTON-CHEUNG
Copy link

JORTON-CHEUNG commented Dec 13, 2024

让cesium的输出路径回溯一层就可以了:
export default defineConfig({ base: "/analysis", plugins: [ vue(), vueJsx(), cesium({ cesiumBaseUrl: '../cesium/' }) ], })

@hqzqaq
Copy link

hqzqaq commented Dec 13, 2024

让cesium的输出路径回溯一层就可以了:
export default defineConfig({ base: "/analysis", plugins: [ vue(), vueJsx(), cesium({ cesiumBaseUrl: '../cesium/' }) ], })

我试过这样,在我的项目中,会导致index.html中引用cesium.js的路径错误

@shuado
Copy link

shuado commented Jan 2, 2025

我是 把CESIUM_BASE_URL = path.posix.join(base, CESIUM_BASE_URL);注释掉解决的

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants