Skip to content

Conversation

austinderek
Copy link
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 28 times, most recently from 24d7fcc to 63cdc65 Compare August 10, 2025 04:06
@austinderek austinderek deleted the fix/raw-loader branch August 13, 2025 09:12
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