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

vite: Add experimental support for Astro #796

Merged
merged 6 commits into from
Sep 9, 2022

Conversation

mechairoi
Copy link
Contributor

Generate CSS when in the Astro build and SSR flag is enabled, similar to the React Server Component (#751).

Will fix #795

The reproduction of #795 seems to work correctly both of dev and build. (The build needs to move pages/index.css.ts outside of pages/ so that it is not treated as an entry point.)

Screenshot 2022-08-25 22 49 18

@mechairoi mechairoi requested a review from a team August 25, 2022 14:23
@changeset-bot
Copy link

changeset-bot bot commented Aug 25, 2022

🦋 Changeset detected

Latest commit: b15c813

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

This PR includes changesets to release 1 package
Name Type
@vanilla-extract/vite-plugin Minor

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

@arthur-fontaine
Copy link

arthur-fontaine commented Aug 25, 2022

I just updated and tested (with your pr) the reproduction to make the build and dev scripts run without error. I also fixed the style not fully applied on the cards.

Copy link
Contributor

@mattcompiles mattcompiles left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR. Changes makes sense. Just a few comments around keeping the plugin as simple as possible.

packages/vite-plugin/src/index.ts Outdated Show resolved Hide resolved
packages/vite-plugin/src/index.ts Outdated Show resolved Hide resolved
packages/vite-plugin/src/index.ts Outdated Show resolved Hide resolved
packages/vite-plugin/src/index.ts Outdated Show resolved Hide resolved
@mechairoi
Copy link
Contributor Author

Thanks for review. I have updated the PR.

Copy link
Contributor

@mattcompiles mattcompiles left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Happy with this as a code change.

@mechairoi Is it worth adding some docs for Astro users? Is it understood that Vite plugins generally work in Astro builds?

@mechairoi
Copy link
Contributor Author

@mattcompiles I think it is better to add some docs. The reference is almost all the description of the Vite plugins in the Astro docs.

@mattcompiles
Copy link
Contributor

@mechairoi I'll merge this for now. If you want to contribute some Astro specific docs then feel free to open another PR 😄

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.

Support for Astro
3 participants