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

Revert "fix: vite root directory not taken into account when set" #57

Merged
merged 1 commit into from
Sep 11, 2024

Conversation

ls-yannick
Copy link

I believe this PR was merged in error. The outDir and root options are 2 separate things in vite, one should not be used to compute the other.

This caused a bug in our build pipeline

  • vite root is /Users/yannick/project/src
  • outDir is /Users/yannick/project/dist

With this change, the cesium files are now generated in /Users/yannick/project/src/Users/yannick/project/dist/cesium. But both root and outDir options are correctly configured.

@jfayot it doesn't look like this plugin was using the root folder of the project at all before, so I don't understand how using a different root than the default would break this plugin. But if you can provide more details I'd be happy to look into it!

@jfayot
Copy link

jfayot commented Sep 11, 2024

Hi @ls-yannick,
honestly, I don't use this plugin anymore as it doesn't handle @cesium/engine, and I don't remember the use case I was facing.
Sorry if this PR broke your pipeline, but it can be reverted if needed.
However, it looks like your root dir is an absolute path... If possible I would with a relative path.

@ls-yannick
Copy link
Author

Thanks for the suggestion! According to the docs root can be an absolute path. I think if we used relative pathes for both root and outDir in our vite config we would not have the issue, but I don't remember why we use path.resolve(__dirname, 'src'). We might change that, but I think the plugin should handle absolute pathes anyway :)

@jfayot
Copy link

jfayot commented Sep 11, 2024

Now you can also go with another plugin: vite-plugin-cesium-build from s3xyst3ak
It seems better maintained and he's an active contributor to the cesium project.
You also have my own plugin vite-plugin-cesium-engine but it only deals with @cesium/engine...

@ls-yannick
Copy link
Author

Cool thanks, I might actually do that!

@nshen
Copy link
Owner

nshen commented Sep 11, 2024

I have lost my job related to Cesium and haven't used Cesium for a long time. If you guys think it's okay, I will merge it. Thank you.

@nshen nshen merged commit b1a756f into nshen:main Sep 11, 2024
4 checks passed
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

Successfully merging this pull request may close these issues.

4 participants