-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Update Browser Extension's Vite Config #2540
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
8fca7aa
to
59a8bfc
Compare
Here's a weird warning that Because of
Unlike the other folders/chunks, I've been looking into the Vite/rollup docs but still lost looking for alternatives or customization options... So any leads would be appreciated 🙏 |
@noi5e Does the whole app it still build correctly if you omit it from the inputs? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updating this to unblock you as I'll be away for a few days. You can't merge it anyway without fixing the existing TS errors. The other files which are JS should ideally be TS as well, if this config allows that to work correctly
Just pushed new commits, every The build still works, manually tested in Chrome/Firefox/Edge. I ran into some troubles with absolute/relative path stuff, like in this example:
If the path is If the path is Also, if I put Otherwise, this PR seems to work fine. Just have to take care of things in #2510 first, then this should be merge ready. |
If I omit |
@acywatson had a suggestion here:
I thought it made sense to try an implementation of that here in this PR, which I made in the latest commit The execution is very awkward because browser extension content and background scripts do not allow ES6 Currently the implementation does not work because I'm encountering a block. In
However So I guess the question is if it's going to be worth it right now to pursue ES6 style imports and modules in the content and background scripts... And if so, any suggestions for how to update the Vite config to build this properly? |
Yea, let's not worry about it for now. Thanks for looking into it! |
This reverts commit 84680f310dc7b38bcafea18fde5ba83a537671ab.
Rebased off This seems ready to merge, the only thing stopping it is unrelated CI failures. One important thing to note is that I had to do a lot of TS linter disabling in
(I'm also currently studying up on TypeScript to see if I can give this a shot myself) |
Possible prerequisite #2510 ⬅️ Look at that PR first, particularly this and this comment
Adjusts the
vite.config.js
to clean up the file/folder structure.Before
After
Next Steps
Not just aesthetic, this PR paves the way for the following changes:
build
the extension with amanifest.json
v3.0, a prerequisite to getting the extension published in Chrome & Edge stores.js
to.ts
(see comment )Developer Tools Web Extension Planning Issue: #2127