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