Skip to content

feat: reference style modules as URL assets#4016

Merged
chenjiahan merged 2 commits intomainfrom
style_url_assets_1119
Nov 19, 2024
Merged

feat: reference style modules as URL assets#4016
chenjiahan merged 2 commits intomainfrom
style_url_assets_1119

Conversation

@chenjiahan
Copy link
Copy Markdown
Member

@chenjiahan chenjiahan commented Nov 19, 2024

Summary

When using new URL() to reference .css or .scss files, they will be treated as URL assets and will not be processed by Rsbuild's built-in CSS loaders.

// foo.css will remain the original content and be output to the dist directory
const fooCss = new URL('./foo.css', import.meta.url).href;

console.log(fooCss); // "/static/foo.[hash].css"

Related Links

The same as #4011

Checklist

  • Tests updated (or not required).
  • Documentation updated (or not required).

@netlify
Copy link
Copy Markdown

netlify Bot commented Nov 19, 2024

Deploy Preview for rsbuild ready!

Name Link
🔨 Latest commit ac833b5
🔍 Latest deploy log https://app.netlify.com/sites/rsbuild/deploys/673c8956c77a2500082a5a8a
😎 Deploy Preview https://deploy-preview-4016--rsbuild.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 82 (🔴 down 1 from production)
Accessibility: 97 (no change from production)
Best Practices: 100 (no change from production)
SEO: 100 (no change from production)
PWA: 60 (no change from production)
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify site configuration.

@chenjiahan chenjiahan merged commit 8594f32 into main Nov 19, 2024
@chenjiahan chenjiahan deleted the style_url_assets_1119 branch November 19, 2024 12:59
@9aoy 9aoy mentioned this pull request Nov 20, 2024
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.

1 participant