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(plugin-css-extract): add enforceRelative plugin option to preserve './' #8946

Merged
merged 1 commit into from
Jan 7, 2025

Conversation

SoonIter
Copy link
Member

@SoonIter SoonIter commented Jan 7, 2025

Summary

different from webpack, add prefer_relative to preserve './'

when set publicPath: "auto" and preferRelative: true

output: {
	publicPath: 'auto'
}
// before
url('static/img/foo.png')
// after
url('./static/img/foo.png')

Why do we need to preserve './'?

folderName like static maybe 3rd pkg from node_modules

in Rslib

  1. it is unclear for understanding
  2. it may cause some corner cases from other bundlers
  3. resolve.alias may affect the url resolution

Checklist

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

@github-actions github-actions bot added team The issue/pr is created by the member of Rspack. release: feature release: feature related release(mr only) labels Jan 7, 2025
Copy link

netlify bot commented Jan 7, 2025

Deploy Preview for rspack ready!

Name Link
🔨 Latest commit 54fd301
🔍 Latest deploy log https://app.netlify.com/sites/rspack/deploys/677cb488c967520008fe9323
😎 Deploy Preview https://deploy-preview-8946--rspack.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

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

@SoonIter SoonIter requested a review from JSerFeng January 7, 2025 04:01
Copy link

codspeed-hq bot commented Jan 7, 2025

CodSpeed Performance Report

Merging #8946 will not alter performance

Comparing syt/css-extract-enforce-relative (54fd301) with main (0a4e43a)

Summary

✅ 3 untouched benchmarks

@SoonIter SoonIter force-pushed the syt/css-extract-enforce-relative branch from 6a419a4 to 54fd301 Compare January 7, 2025 04:58
@SoonIter SoonIter changed the title feat(plugin-css-extract): add preferRelative plugin option feat(plugin-css-extract): add enforceRelative plugin option to preserve './' Jan 7, 2025
@SoonIter
Copy link
Member Author

SoonIter commented Jan 7, 2025

rename preferRelative -> enforceRelative

@JSerFeng JSerFeng merged commit 2cfa879 into main Jan 7, 2025
32 checks passed
@JSerFeng JSerFeng deleted the syt/css-extract-enforce-relative branch January 7, 2025 06:45
@h-a-n-a h-a-n-a mentioned this pull request Jan 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release: feature release: feature related release(mr only) team The issue/pr is created by the member of Rspack.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants