Skip to content

Mirror of upstream PR #82095#25

Closed
austinderek wants to merge 3 commits into
canaryfrom
fix/raw-loader
Closed

Mirror of upstream PR #82095#25
austinderek wants to merge 3 commits into
canaryfrom
fix/raw-loader

Conversation

@austinderek
Copy link
Copy Markdown
Owner

This PR mirrors upstream PR #82095.\n\nAuto-synced from upstream.

nehhhhha6 and others added 3 commits March 29, 2025 18:38
Fixes vercel#82000 - Next.js still imports CSS as styles even when loaded with raw-loader

- Add webpack rules to handle raw-loader imports before CSS processing
- Support multiple raw-loader patterns: ?raw, ?raw-loader, git add packages/next/src/build/webpack/config/blocks/css/index.ts test/integration/css-fixtures/raw-loader-import/next.config.js test/integration/css-fixtures/raw-loader-import/pages/index.js test/integration/css-fixtures/raw-loader-import/pages/styles.css test/integration/css-fixtures/raw-loader-import/test/raw-loader.test.jsraw-loader!
- Return raw source content instead of processed CSS when using raw-loader
- Add test fixture to verify raw-loader behavior

When users import CSS with raw-loader (e.g., require('!!raw-loader!./foo.css')),
they now get raw source content as expected instead of having styles applied.
@austinderek austinderek force-pushed the canary branch 27 times, most recently from 4e06942 to d5dc166 Compare August 5, 2025 16:28
@austinderek austinderek force-pushed the canary branch 30 times, most recently from 6cae6d8 to dccba7d Compare August 6, 2025 21:25
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