Skip to content

Commit 63261b6

Browse files
committed
(#1017) Add Production Build Instructions
This adds instructions on how to build the site for production. This is helpful for users who want verify their changes before submitting a pull request. All errors will be caught during the build process and the user can fix them before submitting a pull request.
1 parent 84bd410 commit 63261b6

File tree

2 files changed

+27
-7
lines changed

2 files changed

+27
-7
lines changed

.vscode/settings.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
"HKEY",
4444
"HKLM",
4545
"honor",
46+
"inotify",
4647
"Internalizer",
4748
"Intune",
4849
"intunewin",

README.md

Lines changed: 26 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Listed below are some of the areas we consider important when writing. We have t
1515

1616
To help with these goals, please refer to our guides on [writing documentation](https://design.chocolatey.org/content-and-marketing/writing-documentation) and the use of [language and grammar](https://design.chocolatey.org/content-and-marketing/language-and-grammar).
1717

18-
## Building the Site
18+
## Building the Site for Development
1919

2020
There are multiple options to build the site:
2121

@@ -30,7 +30,7 @@ Ensure that you have Node v20+ installed by running `node -v`. There is a `.\set
3030

3131
After confirming the required Node version, run the following command from a terminal:
3232

33-
```
33+
```powershell
3434
yarn dev
3535
```
3636

@@ -51,19 +51,37 @@ Follow these steps to open the project in a [Dev Container](https://containers.d
5151

5252
From a terminal, run the following:
5353

54-
```
54+
```powershell
5555
docker build -t chocolatey-docs-container .
5656
```
5757

5858
Once this is complete, run the following from the same terminal:
5959

60-
```
60+
```powershell
6161
docker run -p 5086:5086 -v $(pwd):/app chocolatey-docs-container
6262
```
6363

6464
This will compile the site, and bring up a preview on `http:localhost:5086`. Any changes you make will automatically be hot reloaded.
6565

66-
### Troubleshooting the build
66+
## Building the Site for Production
67+
68+
Building the site for production is a good practice before submitting a pull request. An error of any kind will be flagged in the production build and it will fail.
69+
70+
From a terminal, run the following:
71+
72+
```powershell
73+
yarn build
74+
```
75+
76+
Once this is complete, run the following from the same terminal:
77+
78+
```powershell
79+
yarn preview
80+
```
81+
82+
This will start a server to show what the site will look like in production. Changes made to source files will not be reflected in this preview.
83+
84+
### Troubleshooting the Build
6785

6886
If you are having build errors with `'copyTheme' errored after`, try removing the `node_modules` directory and clearing your yarn cache with `yarn cache clean`.
6987

@@ -102,13 +120,13 @@ The [Chocolatey Design System](https://design.chocolatey.org) and [choco-astro](
102120

103121
To run all the Playwright tests, first run the following command:
104122

105-
```
123+
```powershell
106124
yarn build
107125
```
108126

109127
Once this has completed, run:
110128

111-
```
129+
```powershell
112130
yarn playwright
113131
```
114132

@@ -119,6 +137,7 @@ This will run all Playwright tests and report any errors for further investigati
119137
[![GitHub Actions Build Status](https://github.com/chocolatey/docs/workflows/Publish%20Documentation/badge.svg)](https://github.com/chocolatey/docs/actions?query=workflow%3A%22Build+Pull+Request%22)
120138

121139
## Chat Room
140+
122141
Come join in the conversation about Chocolatey in our [Community Chat Room](https://ch0.co/community).
123142

124143
Please make sure you've read over and agree with the [etiquette regarding communication](https://github.com/chocolatey/choco/blob/master/README.md#etiquette-regarding-communication).

0 commit comments

Comments
 (0)