chialab / rna

🚀 Build tools for modern web modules and applications.
https://chialab.github.io/rna/
MIT License
172 stars 21 forks source link

Introduce `injectStylesAs` config for html plugin #176

Closed edoardocavazza closed 4 months ago

edoardocavazza commented 8 months ago

This PR introduces a injectStylesAs configuration to set the inject behavior for CSS imports in JavaScript modules.

It should fix #172

changeset-bot[bot] commented 8 months ago

🦋 Changeset detected

Latest commit: b190cf1c538ebb28c5e7c8184f8208eac7c43aae

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

This PR includes changesets to release 1 package | Name | Type | | ---------------------------- | ----- | | @chialab/esbuild-plugin-html | 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

codecov[bot] commented 8 months ago

Codecov Report

Attention: Patch coverage is 90.19608% with 5 lines in your changes are missing coverage. Please review.

Project coverage is 75.78%. Comparing base (623f59f) to head (b190cf1).

Files Patch % Lines
packages/esbuild-plugin-html/lib/collectScripts.js 80.00% 0 Missing and 4 partials :warning:
packages/esbuild-plugin-html/lib/index.js 96.00% 0 Missing and 1 partial :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #176 +/- ## ========================================== + Coverage 75.70% 75.78% +0.07% ========================================== Files 28 28 Lines 5034 5067 +33 Branches 776 780 +4 ========================================== + Hits 3811 3840 +29 Misses 467 467 - Partials 756 760 +4 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

benjamingwynn commented 5 months ago

Thank you for your hard work @edoardocavazza !

This is required for CSS in Svelte files loaded via esbuild-svelte to not cause a flash of unstyled content.

Until this PR is merged I've isolated eslint-plugin-html with this patch into a drop-in replacement.