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

Load a new Vite config object for the vite-node compiler #1314

Merged
merged 6 commits into from
Feb 9, 2024

Conversation

mrm007
Copy link
Contributor

@mrm007 mrm007 commented Feb 6, 2024

Fixes #1313.

This is similar to the fix provided by @hi-ogawa in remix-run/remix#7990.
I believe this is a better fix than #1300 and #1308 (see note below).

Now that we load a new copy of the Vite config, we don't have to worry about filtering plugins before passing them to the vite-node compiler, since they don't share any state with the app's Vite config.

Edit: We still need to filter out Remix because the plugins are incompatible with and without a config file.

Copy link

changeset-bot bot commented Feb 6, 2024

🦋 Changeset detected

Latest commit: 8a520d8

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
@vanilla-extract/integration Minor
@vanilla-extract/vite-plugin Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@mrm007 mrm007 marked this pull request as ready for review February 6, 2024 07:31
@mrm007 mrm007 requested a review from markdalgleish February 6, 2024 07:37
@mrm007 mrm007 marked this pull request as draft February 6, 2024 23:15
@mrm007
Copy link
Contributor Author

mrm007 commented Feb 6, 2024

We still need to do something about Remix because we start Vite without a config file

const server = await vite.createServer({
...viteConfig,
configFile: false,

@mrm007 mrm007 marked this pull request as ready for review February 6, 2024 23:31
@mrm007 mrm007 requested a review from askoufis February 6, 2024 23:32
@mrm007 mrm007 enabled auto-merge (squash) February 9, 2024 03:59
@mrm007 mrm007 merged commit e8a6850 into master Feb 9, 2024
11 checks passed
@mrm007 mrm007 deleted the vite-plugin-load-config branch February 9, 2024 04:07
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.

HMR broken with @vanilla-extract/vite-plugin v4.0.1 and later
2 participants