Add support for polyfill configuration in Vite plugin #20037
Replies: 2 comments
|
I think the important design question is whether Tailwind's polyfills are part of the Tailwind output contract or part of the downstream browser-targeting pipeline. If a project sets tailwindcss({
optimize: false,
polyfills: false,
})or a more future-proof shape: tailwindcss({
optimize: false,
polyfills: {
colorMix: false,
logicalProperties: true,
},
})I would prefer a coarse The main risk is support burden: once this is configurable, bug reports need to include both browser target and Tailwind polyfill settings. But from a Vite plugin perspective, giving advanced users explicit ownership of compatibility transforms feels reasonable. |
Uh oh!
There was an error while loading. Please reload this page.
As discussed in PR #19942, it would be great if the Vite plugin exposed an option to configure polyfills.
Currently, when
optimize: falseis set and the project targets browsers through Vite instead, there does not seem to be a way to disable Tailwind’s generated polyfills.I’d like to propose adding a
polyfillsoption alongside optimize in the Vite plugin configuration. This would allow users to either disable polyfills entirely during compilation, or selectively keep only the ones they need.All reactions