Running Frugal
Frugal does not come with any CLI to run your projet. Instead, it lets you write your own production and development scripts.
Development mode
When running in development mode, Frugal will ignore the exporter
configuration. Instead, Frugal will setup a dev server with livereload :
import { context } from "https://deno.land/x/frugal@0.9.6/mod.ts"
import config from "./frugal.config.ts"
await context(config).watch()
1234
After the call to watch
, since we used await, the script will await on the server to terminate. Since the server should never terminate, any code you write after the awaited watch
won't run.
This script is the ideal place to load a .dotenv file.
The dev server should listen on port 3000
, but you can change it by passing a port number to the watch
function.
Production mode
In production mode, frugal will build and export your project and exit :
import { build } from "https://deno.land/x/frugal@0.9.6/mod.ts"
import config from "./frugal.config.ts"
await build(config)
1234
Since the build
function does not start a long running process, you can execute something else after the build is done.