portails/content/docs/prologue/commands.md

107 lines
1.5 KiB
Markdown
Raw Normal View History

2020-11-04 08:26:58 +01:00
---
title: "Commands"
2020-12-03 16:07:04 +01:00
description: "Doks comes with commands for common tasks."
lead: "Doks comes with commands for common tasks."
2020-11-04 08:26:58 +01:00
date: 2020-10-13T15:21:01+02:00
lastmod: 2020-10-13T15:21:01+02:00
draft: false
images: []
menu:
docs:
parent: "prologue"
2020-12-03 16:07:04 +01:00
weight: 130
2020-11-04 08:26:58 +01:00
toc: true
---
2020-11-05 21:09:30 +01:00
{{< alert icon="💡" text="You can change the commands in the scripts section of `./package.json`." >}}
2020-11-04 08:26:58 +01:00
## start
Start local development server:
2020-12-03 16:07:04 +01:00
{{< btn-copy text="npm run start" >}}
2020-11-04 08:26:58 +01:00
```bash
2020-11-05 21:09:30 +01:00
npm run start
2020-11-04 08:26:58 +01:00
```
2020-11-05 21:09:30 +01:00
## lint
2020-11-04 08:26:58 +01:00
2020-11-05 21:09:30 +01:00
Check scripts, styles, and markdown for errors:
2020-11-04 08:26:58 +01:00
2020-12-03 16:07:04 +01:00
{{< btn-copy text="npm run lint" >}}
2020-11-04 08:26:58 +01:00
```bash
2020-11-05 21:09:30 +01:00
npm run lint
2020-11-04 08:26:58 +01:00
```
2020-11-05 21:09:30 +01:00
### scripts
Check scripts for errors:
2020-11-04 08:26:58 +01:00
2020-12-03 16:07:04 +01:00
{{< btn-copy text="npm run lint:scripts" >}}
2020-11-04 08:26:58 +01:00
```bash
2020-11-16 09:35:51 +01:00
npm run lint:scripts [-- --fix]
2020-11-04 08:26:58 +01:00
```
2020-11-05 21:09:30 +01:00
### styles
Check styles for errors:
2020-11-04 08:26:58 +01:00
2020-12-03 16:07:04 +01:00
{{< btn-copy text="npm run lint:styles" >}}
2020-11-04 08:26:58 +01:00
```bash
2020-11-16 09:35:51 +01:00
npm run lint:styles [-- --fix]
2020-11-04 08:26:58 +01:00
```
2020-11-05 21:09:30 +01:00
### markdown
2020-11-04 08:26:58 +01:00
2020-11-05 21:09:30 +01:00
Check markdown for errors:
2020-11-04 08:26:58 +01:00
2020-12-03 16:07:04 +01:00
{{< btn-copy text="npm run lint:markdown" >}}
2020-11-04 08:26:58 +01:00
```bash
2020-11-16 09:35:51 +01:00
npm run lint:markdown [-- --fix]
2020-11-04 08:26:58 +01:00
```
## clean
Delete temporary directories:
2020-12-03 16:07:04 +01:00
{{< btn-copy text="npm run clean" >}}
2020-11-04 08:26:58 +01:00
```bash
2020-11-05 21:09:30 +01:00
npm run clean
2020-11-04 08:26:58 +01:00
```
2020-11-05 21:09:30 +01:00
## build
2020-11-04 08:26:58 +01:00
2020-11-05 21:09:30 +01:00
Build production website:
2020-11-04 08:26:58 +01:00
2020-12-03 16:07:04 +01:00
{{< btn-copy text="npm run build" >}}
2020-11-04 08:26:58 +01:00
```bash
2020-11-05 21:09:30 +01:00
npm run build
2020-11-04 08:26:58 +01:00
```
2020-11-05 21:09:30 +01:00
### functions
2020-11-04 08:26:58 +01:00
2020-11-05 21:09:30 +01:00
Build Lambda functions:
2020-11-04 08:26:58 +01:00
2020-12-03 16:07:04 +01:00
{{< btn-copy text="npm run build:functions" >}}
2020-11-04 08:26:58 +01:00
```bash
2020-11-05 21:09:30 +01:00
npm run build:functions
2020-11-04 08:26:58 +01:00
```
2020-11-05 21:09:30 +01:00
### preview
2020-11-04 08:26:58 +01:00
2020-11-05 21:09:30 +01:00
Build production website including draft and future content:
2020-11-04 08:26:58 +01:00
2020-12-03 16:07:04 +01:00
{{< btn-copy text="npm run build:preview" >}}
2020-11-04 08:26:58 +01:00
```bash
2020-11-05 21:09:30 +01:00
npm run build:preview
2020-11-04 08:26:58 +01:00
```