You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
Copy file name to clipboardExpand all lines: README.md
+26-7Lines changed: 26 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -15,7 +15,7 @@ Listed below are some of the areas we consider important when writing. We have t
15
15
16
16
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).
17
17
18
-
## Building the Site
18
+
## Building the Site for Development
19
19
20
20
There are multiple options to build the site:
21
21
@@ -30,7 +30,7 @@ Ensure that you have Node v20+ installed by running `node -v`. There is a `.\set
30
30
31
31
After confirming the required Node version, run the following command from a terminal:
32
32
33
-
```
33
+
```powershell
34
34
yarn dev
35
35
```
36
36
@@ -51,19 +51,37 @@ Follow these steps to open the project in a [Dev Container](https://containers.d
51
51
52
52
From a terminal, run the following:
53
53
54
-
```
54
+
```powershell
55
55
docker build -t chocolatey-docs-container .
56
56
```
57
57
58
58
Once this is complete, run the following from the same terminal:
59
59
60
-
```
60
+
```powershell
61
61
docker run -p 5086:5086 -v $(pwd):/app chocolatey-docs-container
62
62
```
63
63
64
64
This will compile the site, and bring up a preview on `http:localhost:5086`. Any changes you make will automatically be hot reloaded.
65
65
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
67
85
68
86
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`.
69
87
@@ -102,13 +120,13 @@ The [Chocolatey Design System](https://design.chocolatey.org) and [choco-astro](
102
120
103
121
To run all the Playwright tests, first run the following command:
104
122
105
-
```
123
+
```powershell
106
124
yarn build
107
125
```
108
126
109
127
Once this has completed, run:
110
128
111
-
```
129
+
```powershell
112
130
yarn playwright
113
131
```
114
132
@@ -119,6 +137,7 @@ This will run all Playwright tests and report any errors for further investigati
Come join in the conversation about Chocolatey in our [Community Chat Room](https://ch0.co/community).
123
142
124
143
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