Skip to content

Commit 7997014

Browse files
authored
Merge pull request #262 from colbyfayock/main+export
Remove "export" option from build
2 parents d90f2c0 + fb49ca2 commit 7997014

File tree

4 files changed

+39
-5
lines changed

4 files changed

+39
-5
lines changed

.github/workflows/checks.yml

+23-2
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,13 @@ name: Checks
33
on: [push, pull_request]
44

55
jobs:
6-
checks:
6+
linting:
77
name: Linting
88
runs-on: ubuntu-latest
99
strategy:
1010
matrix:
1111
node-version: [12.x, 14.x]
1212
steps:
13-
# Checkout repo
1413
- uses: actions/checkout@v2
1514

1615
- name: Use Node.js ${{ matrix.node-version }}
@@ -24,3 +23,25 @@ jobs:
2423

2524
# Run linting with yarn
2625
- run: yarn lint
26+
27+
static-compat:
28+
name: Static Compatability
29+
runs-on: ubuntu-latest
30+
strategy:
31+
matrix:
32+
node-version: [12.x, 14.x]
33+
steps:
34+
- uses: actions/checkout@v2
35+
36+
- name: Use Node.js ${{ matrix.node-version }}
37+
uses: actions/setup-node@v1
38+
with:
39+
node-version: ${{ matrix.node-version }}
40+
41+
# install dependencies from yarn.lock
42+
- name: Install dependencies with yarn
43+
run: yarn install --frozen-lockfile
44+
45+
- run: yarn build && yarn export
46+
env:
47+
WORDPRESS_GRAPHQL_ENDPOINT: ${{ secrets.WORDPRESS_GRAPHQL_ENDPOINT }}

.nvmrc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
12
1+
12

README.md

+13-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ WORDPRESS_GRAPHQL_ENDPOINT="http://wordpressite.com/graphql"
2828

2929
### What is this and what does it include?
3030

31-
The goal of this project is to take WordPress as a headless CMS and use Next.js to create a static experience without any 3rd party services that can be deployed anywhere.
31+
The goal of this project is to take WordPress as a headless CMS and use Next.js to create a static experience without any 3rd party services that can be deployed anywhere.
3232

3333
The hope is to build out as many features as we can to support what's typically expected from an out of the box theme on WordPress. Currently, those features include:
3434
* Blog (https://next-wordpress-starter.spacejelly.dev)
@@ -106,6 +106,18 @@ To set up the [ESLint extension](https://marketplace.visualstudio.com/items?item
106106

107107
With this file ESLint will automatically fix and validate syntax errors and format the code on save (based on Prettier configuration).
108108

109+
### Deployment
110+
111+
#### Netlify
112+
113+
There are two options as to how you can deploy this project to Netlify:
114+
* [Essential Next.js Plugin](https://github.com/netlify/netlify-plugin-nextjs) (recommended)
115+
* [Exporting the project](https://nextjs.org/docs/advanced-features/static-html-export) via `next export`
116+
117+
**Essential Next.js Plugin** should be provided as an option when you're first importing a project based on this starter. If it's not, you can install this plugin using the Netlify Plugins directory. This will allow the project to take full advantage of all native Next.js features that Netlify supports with this plugin.
118+
119+
**Exporting the project** let's Next.js compile the project into static assets including HTML files. This allows you to deploy the project as a static site directly to Netlify just like any other site. You can do this by adding `next export` to the end of the `build` command inside `package.json` (ex: `next build && next export`).
120+
109121
## 🛠 Configuring Your Project
110122

111123
### package.json

package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,10 @@
55
"license": "MIT",
66
"author": "Colby Fayock <hello@colbyfayock.com>",
77
"scripts": {
8-
"build": "next build && next export",
8+
"build": "next build",
99
"wpe-build": "npm run build",
1010
"dev": "next dev",
11+
"export": "next export",
1112
"format": "yarn lint --fix",
1213
"format:no-path": "yarn lint:no-path --fix",
1314
"lint": "eslint .",

0 commit comments

Comments
 (0)