klenod-build

klenod-build builds Klenod bundles.

It owns development and build-time behavior:

  • module resolving and graph collection
  • plugins
  • asset generation
  • bundle serialization
  • a basic klenod CLI
  • file watching and updates in development mode

Use this gem when building an application, running development tooling, or authoring build plugins.

require "klenod/build"

context = Klenod::Build::Context.new(source_dir: "src")
context.build(entrypoints: ["pages/server"], output: "dist/klenod.bundle")

Then you can load that bundle with klenod-runtime.

The CLI can also generate a Graphviz DOT-file from a generated bundle:

bundle exec klenod graph dist/klenod.bundle > graph.dot