22
33Next.js and [ node-config] [ ] , together at last.
44
5- ``` console
6- $ npm install next-plugin-node-config
5+ Install with npm:
6+
7+ ``` sh
8+ npm install next-plugin-node-config
79```
810
9- ``` console
10- $ yarn add next-plugin-node-config
11+ Install with Yarn:
12+
13+ ``` sh
14+ yarn add next-plugin-node-config
1115```
1216
1317## Why?
@@ -51,29 +55,29 @@ returns.
5155
5256## Usage
5357
54- Add some configuration files, for example ` config/default.js ` , then add the
58+ Add some configuration files, for example ` config/default.js ` , then add this
5559plugin to ` next.config.js ` .
5660
5761Simplest usage with no existing Next.js config:
5862
5963``` js
60- const withNodeConfig = require (' next-plugin-node-config' );
64+ const withNodeConfig = require (" next-plugin-node-config" );
6165
6266module .exports = withNodeConfig ();
6367```
6468
6569With existing Next.js config:
6670
6771``` js
68- const withNodeConfig = require (' next-plugin-node-config' );
72+ const withNodeConfig = require (" next-plugin-node-config" );
6973
7074module .exports = withNodeConfig ({
7175 // These will be merged on top of anything that comes from `config`!
7276 serverRuntimeConfig: {
73- secret: ' entropy9'
77+ secret: " entropy9"
7478 },
7579 publicRuntimeConfig: {
76- api: ' /graphql'
80+ api: " /graphql"
7781 },
7882 webpack (config , options ) {
7983 // ...
@@ -87,11 +91,11 @@ Using the `nodeConfigServerKey` and `nodeConfigPublicKey` options,
8791your config files:
8892
8993``` js
90- const withNodeConfig = require (' next-plugin-node-config' );
94+ const withNodeConfig = require (" next-plugin-node-config" );
9195
9296module .exports = withNodeConfig ({
93- nodeConfigServerKey: ' server' ,
94- nodeConfigPublicKey: ' public'
97+ nodeConfigServerKey: " server" ,
98+ nodeConfigPublicKey: " public"
9599});
96100```
97101
0 commit comments