warden 0.9.1
warden: ^0.9.1 copied to clipboard
Static Builder CLI
Warden Example #
This directory demonstrates how to configure and run Warden β a static builder CLI for Dart-based frontend builds.
ποΈ Structure #
examples/
βββ bin/
β βββ main.dart # Main Dart source file (compiled to JS)
βββ lib/
β βββ examples.dart # Optional shared logic
βββ sass/
β βββ index.scss # Sass file to compile into CSS
βββ static/ # Output directory for compiled assets
βββ node_modules/ # Your frontend dependencies (Bootstrap, Popper.js, etc.)
βββ warden.yaml # Warden config file
βοΈ warden.yaml #
This file controls how Warden behaves. Here's an example:
source_dir: examples
destination: static/
dependencies:
source: examples/node_modules
bundle: true
main: static/main.js
files:
- 'bootstrap/dist/js/bootstrap.min.js'
- 'popper.js/dist/umd/popper.min.js'
tasks:
frontend:
executable: dart
args: ["compile", "js", "bin/main.dart", "-o", "../static/main.js"]
src: examples
styles:
executable: dart
args: ["run", "sass", "sass/index.scss:../static/index.css"]
src: examples
###βΆοΈ Running the Example
From the root of this directory, run:
dart run warden --file=warden.yaml
This will: β’ Compile bin/main.dart to JS β’ Compile sass/index.scss to CSS β’ Copy and optionally bundle third-party JS files β’ Watch files and recompile automatically
π Notes #
β’ You must have dependencies like bootstrap and popper.js already installed in examples/node_modules.
β’ You can use any frontend packages compatible with Dart or just pure JS/CSS assets.