Skip to content

fix: remove invalid resource query for scripts#5503

Merged
chenjiahan merged 1 commit intomainfrom
js_query_0629
Jun 29, 2025
Merged

fix: remove invalid resource query for scripts#5503
chenjiahan merged 1 commit intomainfrom
js_query_0629

Conversation

@chenjiahan
Copy link
Copy Markdown
Member

Summary

I made a mistake in #5353, the resourceQuery({ not: /raw|inline/ }) should be resourceQuery({ not: /raw/ }) as the inline query are not supported for scripts.

Checklist

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

Copilot AI review requested due to automatic review settings June 29, 2025 08:42
@netlify
Copy link
Copy Markdown

netlify bot commented Jun 29, 2025

Deploy Preview for rsbuild ready!

Name Link
🔨 Latest commit 07bbde5
🔍 Latest deploy log https://app.netlify.com/projects/rsbuild/deploys/6860fc8bb742900008fbc55d
😎 Deploy Preview https://deploy-preview-5503--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: 75 (no change 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 project configuration.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR fixes an issue with resource queries for scripts by removing the unsupported "inline" query from the regex. Key changes include updates to snapshot tests across multiple plugins and a modification to the resourceQuery in the swc plugin.

  • Update snapshot tests in plugin-svelte, plugin-react, plugin-babel, plugin-swc, environments, default, and builder snapshots.
  • Modify the resourceQuery in the swc plugin from /raw|inline/ to /raw/.
  • Ensure consistent handling of resource queries for scripts across the codebase.

Reviewed Changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated no comments.

Show a summary per file
File Description
packages/plugin-svelte/tests/snapshots/index.test.ts.snap Updated resourceQuery regex
packages/plugin-react/tests/snapshots/index.test.ts.snap Updated resourceQuery regex
packages/plugin-babel/tests/snapshots/index.test.ts.snap Updated resourceQuery regex
packages/core/tests/snapshots/swc.test.ts.snap Updated resourceQuery regex
packages/core/tests/snapshots/environments.test.ts.snap Updated resourceQuery regex
packages/core/tests/snapshots/default.test.ts.snap Updated resourceQuery regex
packages/core/tests/snapshots/builder.test.ts.snap Updated resourceQuery regex
packages/core/src/plugins/swc.ts Updated resourceQuery regex and comment for clearer intent
packages/compat/webpack/tests/snapshots/default.test.ts.snap Updated resourceQuery regex
Comments suppressed due to low confidence (1)

packages/core/src/plugins/swc.ts:120

  • The updated comment now references foo.js instead of foo.css, which may be confusing. Please verify and update the comment to accurately reflect that the resource query change applies specifically to script files.
          // exclude `import './foo.js?raw'`

@chenjiahan chenjiahan merged commit 4514df2 into main Jun 29, 2025
12 checks passed
@chenjiahan chenjiahan deleted the js_query_0629 branch June 29, 2025 08:48
@chenjiahan chenjiahan mentioned this pull request Jun 29, 2025
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