S
SolidJS•3mo ago
ap32

How to add babel plugin into new configuration?

Some time ago i created small code transformer using babel https://github.com/ap32/sample-site-finsweet-cft-12/blob/main/macro/join/index.ts#L21 I made it for simpler multiline classes editing (tailwind, unocss). $join('foo', 'bar') will become foo bar, $join(a, b, ...c) will become ${a} ${b} ${[...c].join(' ')} and so on. I was able to add it like that https://github.com/ap32/sample-site-finsweet-cft-12/blob/main/vite.config.ts#L20, but i don't know how to do that in new configuration. Another question, will you still use babel for https://github.com/ryansolid/dom-expressions in the future?
GitHub
GitHub - ryansolid/dom-expressions: A Fine-Grained Runtime for Perf...
A Fine-Grained Runtime for Performant DOM Rendering - ryansolid/dom-expressions
GitHub
sample-site-finsweet-cft-12/vite.config.ts at main · ap32/sample-si...
Statically generated site based on Finsweet Client-First Template 12 - Blog template - ap32/sample-site-finsweet-cft-12
GitHub
sample-site-finsweet-cft-12/macro/join/index.ts at main · ap32/samp...
Statically generated site based on Finsweet Client-First Template 12 - Blog template - ap32/sample-site-finsweet-cft-12
3 Replies
lxsmnsyc
lxsmnsyc•3mo ago
Another question, will you still use babel for https://github.com/ryansolid/dom-expressions in the future?
near future? probably not just install a rollup/vite plugin for babel
lxsmnsyc
lxsmnsyc•3mo ago
npm
vite-plugin-babel
Runs Babel in Vite during all commands. Latest version: 1.2.0, last published: 3 months ago. Start using vite-plugin-babel in your project by running npm i vite-plugin-babel. There are 9 other projects in the npm registry using vite-plugin-babel.
ap32
ap32•3mo ago
@lxsmnsyc 🤖 thank you, i think, i just won't use it