Skip to content

test: switch reload fixtures to built-in css#187

Merged
chenjiahan merged 2 commits intomainfrom
chenjiahan/fix-reload-css-tests
Apr 2, 2026
Merged

test: switch reload fixtures to built-in css#187
chenjiahan merged 2 commits intomainfrom
chenjiahan/fix-reload-css-tests

Conversation

@chenjiahan
Copy link
Copy Markdown
Member

Summary

  • switch the reload test fixtures from style-loader/css-loader to built-in CSS handling
  • load emitted CSS assets in the generated test HTML so the hot reload fixtures still apply styles in the browser
  • update the hot reload snapshots to match the new HMR output

Testing

  • npx rstest hot
  • npx rstest progress

Related Links

  • None

Copilot AI review requested due to automatic review settings April 2, 2026 09:14
Copy link
Copy Markdown

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

Updates the hot-reload test setup to rely on Rspack’s built-in CSS handling instead of style-loader/css-loader, and adjusts the fixture HTML + snapshots accordingly.

Changes:

  • Switch reload fixtures’ .css handling from loader-based to type: 'css'.
  • Update the HTML generator used in tests to include emitted CSS assets via <link> tags.
  • Remove loader dependencies and update hot-reload snapshots to match the new HMR output.

Reviewed changes

Copilot reviewed 6 out of 7 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
tests/helpers/normalize.js Removes normalization logic specific to css-loader paths (no longer needed).
tests/helpers/html-generator-plugin.js Injects <link> tags for emitted CSS assets into generated index.html.
tests/fixtures/reload-config/rspack.config.js Switches CSS handling to built-in type: 'css'.
tests/fixtures/reload-config-2/rspack.config.js Switches CSS handling to built-in type: 'css'.
tests/e2e/snapshots/hot-and-live-reload.test.js.snap Updates expected HMR logs after changing CSS pipeline.
package.json Removes css-loader and style-loader deps.
pnpm-lock.yaml Reflects dependency removals and resulting lockfile updates.
Files not reviewed (1)
  • pnpm-lock.yaml: Language not supported

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@chenjiahan chenjiahan merged commit f8c7ecb into main Apr 2, 2026
3 checks passed
@chenjiahan chenjiahan deleted the chenjiahan/fix-reload-css-tests branch April 2, 2026 09:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants