tailwindcss/integrations
Philipp Spiess e1a85ac260
Vite: Skip parsing stylesheets with the ?commonjs-proxy flag (#16238)
Fixes #16233

Vite has a number of special parameters that can be appended to `.css`
files that make it actually load as a JavaScript module. One such
parameter that we haven't handled before is the `?commonjs-proxy` flag.
When importing e.g. `plotly.js/lib/core`, the dependency tree would
eventually load a file called `*.css?commonjs-proxy`. We previously
scanned this for candidates even though it was not, in-fact, a
stylesheet.

This PR fixes this by adding the `?commonjs-proxy` to the ignore list. I
have also updated `SPECIAL_QUERY_RE` to more closely match the Vite
implementation. It does seem like this was the only condition we were
missing, though:
2b2299cbac/packages/vite/src/node/plugins/css.ts (L511-L517)

## Test plan

Add and import `plotly.js/lib/core` into a Vite app. I also added an
integration test to do that.

Co-authored-by: Robin Malfait <malfait.robin@gmail.com>
2025-02-04 12:45:23 +01:00
..
cli Do not emit empty rules/at-rules (#16121) 2025-01-31 17:56:52 +01:00
postcss Implement @variant (#15663) 2025-01-21 10:20:35 -05:00
upgrade Implement @variant (#15663) 2025-01-21 10:20:35 -05:00
vite Vite: Skip parsing stylesheets with the ?commonjs-proxy flag (#16238) 2025-02-04 12:45:23 +01:00
package.json Update fast-glob 3.3.2 → 3.3.3 (patch) (#15607) 2025-01-13 11:11:35 +01:00
utils.ts Don’t look at ignore files outside initialized repos (#15941) 2025-01-28 16:13:16 +00:00
vitest.config.ts Improve integration tests (stability + performance) (#15125) 2024-12-12 13:48:56 +01:00