Describe the bug
Nowadays with [email protected]+, we always use cleanUrl(id) which removes extra query parameter information potentially added in the Vite/rollup build steps when we pass the file off to the PostCSS plugins. This behavior was changed in #7173 (specifically).
Before (id) |
After (cleanUrl(id)) |
/Users/eric/Documents/github/element/hydrogen-web/src/platform/web/ui/css/themes/element/theme.css?variant=dark&dark=true |
/Users/eric/Documents/github/element/hydrogen-web/src/platform/web/ui/css/themes/element/theme.css |
Before [email protected], we would directly pass the id to the PostCSS from field which plugins can access via root.source.input.from. This old behavior was used in one of our custom PostCSS plugins to filter out certain files based on those ?variant=dark&dark=true query parameters.
I'm wondering if this was a totally intentional change and we need to refactor our PostCSS plugin to work around this? Or if Vite should be adjusted to accommodate again?
Spawned from element-hq/hydrogen-web#722
Reproduction
https://stackblitz.com/edit/vitejs-vite-bswz32?file=my-postcss-plugin.js&terminal=dev
System Info
npx envinfo --system --npmPackages '{vite,@vitejs/*}' --binaries --browsers
System:
OS: Windows 10 10.0.19044
Binaries:
Node: 16.14.0 - C:\Program Files\nodejs\node.EXE
Yarn: 1.22.18 - C:\Program Files\nodejs\yarn.CMD
npm: 8.3.1 - C:\Program Files\nodejs\npm.CMD
Used Package Manager
yarn
Logs
No response
Validations
Describe the bug
Nowadays with
[email protected]+, we always usecleanUrl(id)which removes extra query parameter information potentially added in the Vite/rollup build steps when we pass the file off to the PostCSS plugins. This behavior was changed in #7173 (specifically).id)cleanUrl(id))/Users/eric/Documents/github/element/hydrogen-web/src/platform/web/ui/css/themes/element/theme.css?variant=dark&dark=true/Users/eric/Documents/github/element/hydrogen-web/src/platform/web/ui/css/themes/element/theme.cssBefore
[email protected], we would directly pass theidto the PostCSSfromfield which plugins can access viaroot.source.input.from. This old behavior was used in one of our custom PostCSS plugins to filter out certain files based on those?variant=dark&dark=truequery parameters.I'm wondering if this was a totally intentional change and we need to refactor our PostCSS plugin to work around this? Or if Vite should be adjusted to accommodate again?
Spawned from element-hq/hydrogen-web#722
Reproduction
https://stackblitz.com/edit/vitejs-vite-bswz32?file=my-postcss-plugin.js&terminal=dev
System Info
Used Package Manager
yarn
Logs
No response
Validations