Jaspr CLI

Create, serve and build projects using the Jaspr CLI.

Commands

Jaspr comes with a cli tool to create, serve and build your website.

  • jaspr create: Create a new jaspr project. See Project Scaffolding
  • jaspr serve: Serve the project and automatically refresh when you make changes.
  • jaspr build: Build the project according to the selected rendering mode.

Additionally, there are the following service commands available:

  • jaspr doctor: Show information about the environment and current project.
  • jaspr clean: Delete the build/ and .dart_tool/ directories.
  • jaspr update: Update the jaspr cli.

Development Server

You can start your Jaspr project in development mode using:

jaspr serve

This will spin up a development server that automatically watches your project files for changes and rebuild your project.

Building

When it's time to deploy your application, you can build it using the following command:

jaspr build

This will build the app inside the build/jaspr/ directory according to your selected Rendering Mode:

Static Mode

Jaspr will start the server entrypoint of your project and pre-render all pages into separate .html files. The pre-rendered pages and all files from web/ are built to the build/jaspr/ directory, which you can deploy to any static hosting provider.

Server Mode

Jaspr will build a server runnable as well as static assets from web/. For the server runnable you can choose whether to build a standalone executable (default), an aot snapshot or kernel module with the --target option.

Your server app will be compiled to build/jaspr/app<.exe/.aot/.dill>. Your static files and assets will be built to the build/jaspr/web directory, which must be kept alongside the server executable during deployment.

Client Mode

All files are built to the build/jaspr/ directory, which you can deploy to any static hosting provider.