The following flags are available:
- -i/--input <pathToFile>: the input file (in most cases mod.ts)
- -o/--output <pathToFile>: the output file name
- -d/--dir <pathToDir>: the output directory. Setting this is needed for code splitting and always takes precedence over -o
- -c/--config <pathToConfig>: the config file. Use --defaultConfig to see the default values.
- --cache <cacheLocation>: location to persist build cache
- --watch <dirOrFile>: watch a file or directory and rebuild on changes
- --defaultConfig: prints the default config to stdout
- --print: prints the generated bundle to stdout
- -v/--version: display version number
- -h/--help: display the CLI help message
NOTE: both denopack and its plugins use unstable Deno APIs. These APIs are not final and may break, but this does mean --unstable is mandatory!
The CLI itself can run with a base permission of --allow-read, printing to stdout with the -p flag. Writing to file naturally requires --allow-write.
Additionally, the various built-in plugins can require extra permissions like --allow-net and --allow-env. More info can be found in the plugin folder on Github.
Importing a Rollup config file is supported using the -c <path/to/config> flag and follow the same conventions as Rollup:
- use default export for your config
- ideally call it rollup.config.ts or denopack.config.ts