How to use this in the browser? #278
Answered
by
james-pre
RenaKunisaki
asked this question in
Q&A
-
|
It seems like this is supposed to be possible, but I can't find any examples or info? |
Beta Was this translation helpful? Give feedback.
Answered by
james-pre
Nov 24, 2025
Replies: 1 comment 4 replies
-
|
Hey @RenaKunisaki, How you use ZenFS depends heavily on your use case. If you are just looking to get something working without setting up tooling, I recommend using an import map with esm.sh to quickly be able to import just like in the examples. |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hey @RenaKunisaki,
<script src="...">is for when you are using library bundles and the like. Assuming that's the route you want to take, you'd probably want to bundle your app.For your specific use-case you may want to try something like Vite, which would allow you to do
<script src="main.ts" type="module">and move on to the important stuff.When Vite doesn't fit the use case, my go-to bundler is esbuild. Many others like Webpack and Rollup also work.
Bundling like this is extremely common, so you can easily find plenty of documentation and examples online.