Open CorruptedHeart opened 7 months ago
Couldn't you simply specify your own copy of the @babel/plugin-transform-react-jsx
plugin with the necessary options?
@rschristian due to the order of the spreads here: https://github.com/preactjs/preset-vite/blob/main/src/index.ts#L193-L202, it causes warnings about duplicate plugins.
Also, we'd be relying on the users to also care about stuff like isProduction
, etc.
In that case, perhaps we can detect if the user-provided plugins contains the jsx transform, and if so, replace the plugin config completely (rather than spread into it)?
Another config option is worst-case scenario, and doesn't seem fitting for a niche Babel option.
Also, we'd be relying on the users to also care about stuff like
isProduction
, etc.
Their config, their choice whether to care or not.
It appears that specifying
throwIfNamespace
in a.babelrc
file no longer causes it to apply to the@babel/plugin-transform-react-jsx
or@babel/plugin-transform-react-jsx-development
. Even if specifyingbabelrc: true
as a config option.This is to allow stuff like
unocss
attributify mode which supports attributes likedisabled:bg-grey
on elements.Currently the only documented use case is
throwIfNamespace
.