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

fix(dev): lazily generate CSS bundle #6535

Merged
merged 4 commits into from
Jun 7, 2023

Conversation

markdalgleish
Copy link
Member

In order to improve build performance of Remix projects that aren't using CSS bundling features, this PR modifies the compiler so that the CSS bundle build (which is a separate esbuild compilation) isn't started until an import of @remix-run/css-bundle is detected in the client and server builds.

Since the cssBundleHref value is now entirely managed by an esbuild plugin, it's no longer part of the Remix manifest. This meant that the css-bundle package could be simplified. It no longer reads the manifest which means it doesn't depend on @remix-run/dev anymore, and it doesn't need to have different logic for client and server, so it can now be expressed in a single index.ts file.

@changeset-bot
Copy link

changeset-bot bot commented Jun 5, 2023

🦋 Changeset detected

Latest commit: 3a3da5a

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

This PR includes changesets to release 18 packages
Name Type
@remix-run/css-bundle Patch
@remix-run/dev Patch
create-remix Patch
remix Patch
@remix-run/architect Patch
@remix-run/cloudflare Patch
@remix-run/cloudflare-pages Patch
@remix-run/cloudflare-workers Patch
@remix-run/deno Patch
@remix-run/eslint-config Patch
@remix-run/express Patch
@remix-run/netlify Patch
@remix-run/node Patch
@remix-run/react Patch
@remix-run/serve Patch
@remix-run/server-runtime Patch
@remix-run/testing Patch
@remix-run/vercel 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

@markdalgleish markdalgleish merged commit 4de1c13 into dev Jun 7, 2023
@markdalgleish markdalgleish deleted the markdalgleish/lazy-css-bundle branch June 7, 2023 21:04
@github-actions
Copy link
Contributor

github-actions bot commented Jun 8, 2023

🤖 Hello there,

We just published version v0.0.0-nightly-a23338b-20230608 which includes this pull request. If you'd like to take it for a test run please try it out and let us know what you think!

Thanks!

@github-actions
Copy link
Contributor

github-actions bot commented Jun 8, 2023

🤖 Hello there,

We just published version 1.17.1-pre.0 which includes this pull request. If you'd like to take it for a test run please try it out and let us know what you think!

Thanks!

@github-actions
Copy link
Contributor

🤖 Hello there,

We just published version 1.17.1 which includes this pull request. If you'd like to take it for a test run please try it out and let us know what you think!

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants