I'm currently trying to use https://github.com/hayleigh-dot-dev/gleam-lustre. My naive approach of relying on the generated JS in the browser gets the following error.
Uncaught TypeError: The specifier “react” was a bare specifier, but was not remapped to anything. Relative module specifiers must start with “./”, “../” or “/”.
I think the only solution is to js a JS build tool. looking at the example project in lustre vite is used.
Is there a way to rely on JS libraries without needing a JS build tool.
- Could we use ffi that pointed to the node_modules directory? so that the gleam build would copy them into the build dir
- Can we get npm to save files somewhere else?
Note: I have "solved" this by commenting out the react imports at the top of lustre ffi and relying on global imports. https://github.com/hayleigh-dot-dev/gleam-lustre/blob/main/src/ffi.mjs#L1-L2
Maybe this is good enough.