This repository houses an example of how to use Bazel to build a Svelte application.
It leverages rules_js, rules_ts, rules_esbuild, and rules_pkg to hermetically build and package the application.
Install Bazel on your development machine.
bazel run //dev/server
To enable live-reload run with Bazel watcher.
bazel build //:static_tar
tar
file will be located under bazel-bin/static_tar.tar
relative to the directory rootThis example is the bare-bones minimum to build a Svelte app. It does not contain any of the syntactic sugar such as +page.svelte
provided by the Vite compiler in SvelteKit. This example compiles and bundles using esbuild instead.
For an example of how to use Vite check out https://github.com/mikberg/bazel-vite.