Command line usage

Using the command line interface of Lume

Build the site

Run the following to build your website:

npm run build
pnpm build
yarn build

This command compiles the source files to HTML and save them into the dest directory (usually _site).

Start a local server

Typically you will want to start a local server and open the site in your browser. To do that, use the serve script:

npm run serve
pnpm serve
yarn serve

This command initializes a local web server and starts watching the changes of the source files. If you edit any file, Lume will detect this change, rebuild the site and refresh your browser automatically. The local server use the port 3000 by default but you can change it with the --port (or -p) argument. For example:

npm run serve -- --port=8000
pnpm serve --port=8000
yarn serve --port=8000

To watch changes without starting a local server, use the --watch argument:

npm run build -- --watch
pnpm build --watch
yarn build --watch

Debug

Use the --inspect, -i flag to start an inspector server. Then, you can open the chrome://inspect URL in any Chromium-based browser and add breakpoints to debug your code:

npm run build -- --inspect
pnpm build --inspect
yarn build --inspect

Note

Use the keyword debugger to create a breakpoint.

The flag --dry-run build the site without writting the output in the disk returning an error if the build generated any error, which is useful for CI testing:

npm run build -- --dry-run
pnpm build --dry-run
yarn build --dry-run

Help

Run npx lume -h to show all available commands and options.