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

Introduce injectStylesAs config for html plugin #176

Merged
merged 1 commit into from
Jun 14, 2024

Conversation

edoardocavazza
Copy link
Member

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

It should fix #172

Copy link

changeset-bot bot commented Mar 6, 2024

🦋 Changeset detected

Latest commit: b190cf1

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

Copy link

codecov bot commented Mar 6, 2024

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 ⚠️
packages/esbuild-plugin-html/lib/index.js 96.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            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     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@benjamingwynn
Copy link

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.

@edoardocavazza edoardocavazza merged commit 3e48a3e into main Jun 14, 2024
8 checks passed
@edoardocavazza edoardocavazza deleted the inject-styles-as-config branch June 14, 2024 07:53
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.

Insert <link> directly, without an intermediate <script>
2 participants