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

fix(core): output.assetsInclude adds a rule but not exposes public api #4385

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

SoonIter
Copy link
Member

@SoonIter SoonIter commented Jan 17, 2025

Summary

not regular

image image

should be ${type}-asset-url

font  font-asset-url
additional  additional-asset-url

Related Links

for Rslib Asset
web-infra-dev/rslib#684

Checklist

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

Copy link

netlify bot commented Jan 17, 2025

Deploy Preview for rsbuild ready!

Name Link
🔨 Latest commit 9b7ef95
🔍 Latest deploy log https://app.netlify.com/sites/rsbuild/deploys/678a1ec9ab3c9d0008c261d6
😎 Deploy Preview https://deploy-preview-4385--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: 73 (🟢 up 5 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.

@SoonIter SoonIter changed the title fix(core): output.assetsInclude add a rule but not export public api fix(core): output.assetsInclude adds a rule but not exposes public api Jan 17, 2025
@SoonIter SoonIter requested a review from chenjiahan January 17, 2025 09:18
@@ -99,6 +99,8 @@ export const CHAIN_ID = {
IMAGE: 'image',
/** Rule for media */
MEDIA: 'media',
/** Rule for additional asset */
ADDITIONAL: 'additional',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not use additional-assets here

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is additional-asets-asset-url acceptable?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But additional-assets-asset-url is not a Rule name.

@@ -131,7 +131,7 @@ export const pluginAsset = (): RsbuildPlugin => ({
const { assetsInclude } = config.source;
if (assetsInclude) {
const { dataUriLimit } = config.output;
const rule = chain.module.rule('additional-assets').test(assetsInclude);
const rule = chain.module.rule('additional').test(assetsInclude);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should use CHAIN_ID.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same as above,
font, image does not use CHAIN_ID
CHAIN_ID only for public api now

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we are not using CHAIN_ID here, why does this PR need to update the CHIND_ID constant?

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