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

feat(css): support css asset in bundle mode and esm/cjs #573

Merged
merged 7 commits into from
Dec 18, 2024

Conversation

SoonIter
Copy link
Member

@SoonIter SoonIter commented Dec 18, 2024

Summary

  • set dataUriLimit: 0 as default
  • support background: url(./assets/logo.svg)

if user want to keep asset import statement as lib (middle-level artifacts), user should turn on "publicPath": "auto" to keep relative import of asset

// in Rsbuild
output: {
	assetPrefix: 'auto'
}

// in webpack/Rspack
ouput: {
   pubicPath: 'auto'
}

this is not supported in js asset now(only in css asset), so after js asset support, I'll set assetPrefix: 'auto' as default value

I'll do js asset part in web-infra-dev/rspack#8748, remove publicPath: auto runtime code and keep import statement

why publicPath: auto should be default value?

  • If users want to set publicPath, it is usually a umd/mf product, but we already have format: 'umd' or format: 'mf' to support, so users should rarely manully configure publicPath
mode/format esm/cjs umd mf
bundle 'auto' publicPath: '/' publicPath: '/'
bundleless 'auto' NIL NIL

Related links

#570

@SoonIter SoonIter force-pushed the feat/support-css-asset-bundle branch from 6e67b32 to 00c9732 Compare December 18, 2024 06:20
@SoonIter SoonIter mentioned this pull request Dec 18, 2024
6 tasks
@SoonIter SoonIter changed the title feat(css): support asset in bundle feat(css): support css asset in bundle esm/cjs Dec 18, 2024
@SoonIter SoonIter changed the title feat(css): support css asset in bundle esm/cjs feat(css): support css asset in bundle mode and esm/cjs Dec 18, 2024
Copy link

codspeed-hq bot commented Dec 18, 2024

CodSpeed Performance Report

Merging #573 will not alter performance

Comparing feat/support-css-asset-bundle (f6cc881) with main (72587ed)

Summary

✅ 5 untouched benchmarks

@fi3ework fi3ework merged commit 5bab1d5 into main Dec 18, 2024
24 checks passed
@fi3ework fi3ework deleted the feat/support-css-asset-bundle branch December 18, 2024 13:30
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