warden 0.2.1 copy "warden: ^0.2.1" to clipboard
warden: ^0.2.1 copied to clipboard

Static Builder CLI

pub package Dart

Warden #

Static Builder CLI

Warden is a lightweight CLI tool to watch and compile Dart and Sass files for frontend projects. It's designed for projects that use server-side rendered HTML but still want custom JS/CSS assets compiled automatically.

๐Ÿ“š Docs: pub.dev/packages/warden


โœจ Features #

  • ๐Ÿ” Watches your Dart and Sass files and recompiles on change
  • ๐Ÿ“ฆ Moves specified dependencies (e.g. node_modules assets) into your build output
  • ๐Ÿ› ๏ธ Bundles your dependency JS files into a single bundle.js (optional)
  • ๐Ÿงฑ Fully configurable via a warden.yaml file
  • ๐ŸŽฏ Supports multiple tasks like compiling Dart to JS and Sass to CSS

โš™๏ธ Setup #

Create a warden.yaml in your project root:

# The root directory of your source files
source_dir: examples

# Where to output built files (JavaScript, CSS, etc.)
destination: static/

# Dependency handling (e.g. node_modules)
dependencies:
  source: examples/node_modules
  bundle: true                      # (Optional) Bundle all files into a single bundle.js
  main: static/main.js              # (Optional) Dart-built JS to append to the bundle
  files:
    - 'poppyjs/dist/Poppy.min.js'
    - 'bootstrap/dist/js/bootstrap.min.js'

# Tasks to run (like build steps)
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 #

Run Warden from your terminal in watch mode:

dart run warden --file=warden.yaml

This will: โ€ข Move files listed in dependencies.files into the output directory โ€ข Bundle them into a single bundle.js if bundle: true โ€ข Compile Dart to JS โ€ข Compile Sass to CSS โ€ข Watch and recompile on file changes

๐Ÿ“ฆ Installation (coming soon) #

dart pub global activate warden

Then run from any Dart project:

warden --file=warden.yaml

๐Ÿงช Example Project Structure #

examples/
โ”œโ”€โ”€ bin/
โ”‚   โ””โ”€โ”€ main.dart
โ”œโ”€โ”€ lib/
โ”‚   โ””โ”€โ”€ examples.dart
โ”œโ”€โ”€ sass/
โ”‚   โ””โ”€โ”€ index.scss
โ”œโ”€โ”€ node_modules/
โ”œโ”€โ”€ warden.yaml

License

MIT ยฉ 2025 joegasewicz

7
likes
0
points
142
downloads

Publisher

unverified uploader

Weekly Downloads

Static Builder CLI

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

ansicolor, args, path, watcher, yaml

More

Packages that depend on warden