-
Notifications
You must be signed in to change notification settings - Fork 176
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
Relative path with "sideEffects": false
silently breaks pages
#655
Comments
Closing temporarily as I missed one thing in reproduction and after fixing it it seems to work. I need to provide a better one because I definitely see an issue locally |
Found the actual issue, renamed issue and edited description |
"sideEffects": false
silently breaks pages
I was able to reproduce this with a vanilla Vite project, and it looks like Vite is tracking this bug in this issue. Closing since it's a Vite issue. |
@filipw01 This is a truly perfect minimal reproduction. Thank you! 🤗 We should add a link to a CRXJS project on StackBlitz, it makes everything so easy. |
I didn't think it might be an issue with Vite itself. Thank you for the link. I might find a moment to add a link to StackBlitz somewhere |
@jacksteamdev I created this vanilla js project which I think we could link in the issue template https://stackblitz.com/edit/stackblitz-webcontainer-api-starter-humgcr Feel free to fork it with your account to be in full control of it |
Build tool
Vite
Where do you see the problem?
Describe the bug
There is a page declared in
vite.config.js
-page.html
importing./main.js
When there is
"sideEffects": false
declared inpackage.json
vite bundles only modulepreload polyfill ignoring
main.js
When there is no
"sideEffects": false
declared inpackage.json
vite correctly bundles both modulepreload polyfill and
main.js
file into one fileWhen
page.html
imports/main.js
instead (absolute path) it works as expected bundling both modulepreload polyfill andmain.js
file into one fileMy fix is to use absolute paths, but I would expect either an error or relative paths working as expected
Reproduction
https://stackblitz.com/edit/stackblitz-webcontainer-api-starter-ukxxhl?file=package.json
Logs
No response
System Info
You can see everything in reproduction too, but for me it's
Severity
annoyance
The text was updated successfully, but these errors were encountered: