#Custom plugin: `vite build` works but `vite dev` loads file without transform

1 messages · Page 1 of 1 (latest)

river loom
#

Hey there,

we're working on a Vite plugin for ClojureScript (/squint-cljs) and I found that when referencing a .cljs file in index.html it only works with vite build.

vite dev will load the .cljs in verbatim, i.e. without transpilation of through our plugin.

The plugin code can be found here: https://github.com/squint-cljs/squint-vite-plugin
The repo also contains a demo/ where this behavior can be observed.

Any pointers greatly appreciated 🙏

GitHub

A plugin to compile .cljs source code with squint using vite - squint-cljs/vite-plugin-squint

#

One workaround we found is to reference a .js file in index.html and have that import the .cljs file. Then transforms are applied as expected.

But it would be nice to achieve both.

river loom