Build & Run

To create a static site we use nuxi generate, to run the project in development mode we use nuxi dev.

For unix-like systems use Makefile;

make build
make run

For Windows systems use build.bat;

.\build.bat
.\run.bat

Process

Process consists of 2 stages;

  1. Setup has 2 stage in itself
    1. Lint checking using eslint
    2. Prebuild, markdowns are preprocessed in this stage
  2. Last stage differs between build & run
    1. When building, there are two different options
      1. It creates a static site for deployment
      2. It creates a static site for local testing
    2. When running locally, there are two different options too
      1. It runs application in development mode
      2. It generate a static site and runs it

diagram

package.json Configuration

We configure build/run commands with the scripts in the package.json that we edit to run processes such as Eslint, Prebuild.

Argument Passing/Parsing

We took help from arguments to reduce repetitive steps and to improve with parameters in scripts. Have a look at .theme/package.json to see use.

We used cross-env to avoid using different syntax for different operating systems.

Using npx

We run http-server package via npx, which allows it to be used without installing to reduce dependencies. Have a look at .theme/package.json to see use.