Bun plugin
I could be missing some non-obvious way to handle that, but from what I can tell none of the provided plugins works with the Bun bundler. Would be nice to have a version that does.
Current solution: I added the ability to pass Babel options to my @atulin/bun-plugin-solid fork. The code below works just fine:
import { SolidPlugin } from "@atulin/bun-plugin-solid";
import solidLabels from "solid-labels/babel";
await Bun.build({
entrypoints: "./src",
outdir: "./dist",
plugins: [
SolidPlugin({
babelOptions: {
plugins: [[solidLabels, {}]],
},
}),
],
});
Yeah currently solid-labels only supports what unplugin supports
Found an issue with this approach: the only way I could get types supported in Rider, was by creating a types/solid-ext.d.ts file with import "solid-labels"; in it. That makes all $signal() and other transpiled functions recognized and work correctly.
Alas, it makes the re-exported stuff not work. For example $resource() doesn't get imported into the resulting file. Neither do the Solid components like <Show>. The IDE treats them as if they were being autoimported and so it shows no errors on usage, and it doesn't add them to the import {} from 'solid-js' list.
After compilation, though, the browser throws a _Show is not defined error in the console, so something is amiss.