Skip to content

Commit 544c646

Browse files
Update Readme.md (#31)
Updated phases call and links in README.md. Co-authored-by: Cyril Wanner <[email protected]>
1 parent f0e87f6 commit 544c646

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

README.md

+9-9
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ You can also overwrite specific configuration keys for a phase:
6868

6969
```javascript
7070
const withPlugins = require('next-compose-plugins');
71-
const { PHASE_PRODUCTION_BUILD } = require('next-server/constants');
71+
const { PHASE_PRODUCTION_BUILD } = require('next/constants');
7272
const sass = require('@zeit/next-sass');
7373

7474
module.exports = withPlugins([
@@ -88,16 +88,16 @@ module.exports = withPlugins([
8888

8989
This will overwrite the `cssLoaderOptions` with the new `localIdentName` specified, but **only** during production build.
9090
You can also combine multiple phases (`[PHASE_PRODUCTION_BUILD + PHASE_PRODUCTION_SERVER]: {}`) or exclude a phase (`['!' + PHASE_PRODUCTION_BUILD]: {}` which will overwrite the config in all phases except `PRODUCTION_BUILD`).
91-
You can use all phases [next.js provides](https://github.com/zeit/next.js/blob/canary/packages/next-server/lib/constants.ts).
91+
You can use all phases [next.js provides](https://github.com/zeit/next.js/blob/canary/packages/next/next-server/lib/constants.ts#L1-L4).
9292

9393
##### `phases?: array`
9494

9595
If the plugin should only be applied in specific phases, you can specify them here.
96-
You can use all phases [next.js provides](https://github.com/zeit/next.js/blob/canary/packages/next-server/lib/constants.ts).
96+
You can use all phases [next.js provides](https://github.com/zeit/next.js/blob/canary/packages/next/next-server/lib/constants.ts#L1-L4).
9797

9898
```javascript
9999
const withPlugins = require('next-compose-plugins');
100-
const { PHASE_DEVELOPMENT_SERVER, PHASE_PRODUCTION_BUILD } = require('next-server/constants');
100+
const { PHASE_DEVELOPMENT_SERVER, PHASE_PRODUCTION_BUILD } = require('next/constants');
101101
const sass = require('@zeit/next-sass');
102102

103103
module.exports = withPlugins([
@@ -114,7 +114,7 @@ You can also negate the phases with a leading `!`:
114114

115115
```javascript
116116
const withPlugins = require('next-compose-plugins');
117-
const { PHASE_DEVELOPMENT_SERVER, PHASE_PRODUCTION_BUILD } = require('next-server/constants');
117+
const { PHASE_DEVELOPMENT_SERVER, PHASE_PRODUCTION_BUILD } = require('next/constants');
118118
const sass = require('@zeit/next-sass');
119119

120120
module.exports = withPlugins([
@@ -155,7 +155,7 @@ module.exports = withPlugins([
155155

156156
Phases are also supported within the `nextConfiguration` object and have the same syntax as in [plugin `configuration` objects](#configuration-object).
157157
```javascript
158-
const { PHASE_DEVELOPMENT_SERVER } = require('next-server/constants');
158+
const { PHASE_DEVELOPMENT_SERVER } = require('next/constants');
159159
const nextConfig = {
160160
distDir: 'build',
161161
['!' + PHASE_DEVELOPMENT_SERVER]: {
@@ -172,7 +172,7 @@ If you don't use the `optional` helper in this case, you would get an error.
172172

173173
```javascript
174174
const { withPlugins, optional } = require('next-compose-plugins');
175-
const { PHASE_DEVELOPMENT_SERVER } = require('next-server/constants');
175+
const { PHASE_DEVELOPMENT_SERVER } = require('next/constants');
176176

177177
module.exports = withPlugins([
178178
[optional(() => require('@zeit/next-sass')), { /* optional configuration */ }, [PHASE_DEVELOPMENT_SERVER]],
@@ -223,7 +223,7 @@ However, if you use them, you should mention somewhere in your readme or install
223223
You can specify in which phases your plugin should get executed within the object you return:
224224

225225
```javascript
226-
const { PHASE_DEVELOPMENT_SERVER } = require('next-server/constants');
226+
const { PHASE_DEVELOPMENT_SERVER } = require('next/constants');
227227

228228
module.exports = (nextConfig = {}) => {
229229
return Object.assign({}, nextConfig, {
@@ -326,7 +326,7 @@ const {
326326
PHASE_PRODUCTION_SERVER,
327327
PHASE_DEVELOPMENT_SERVER,
328328
PHASE_EXPORT,
329-
} = require('next-server/constants');
329+
} = require('next/constants');
330330

331331
// next.js configuration
332332
const nextConfig = {

0 commit comments

Comments
 (0)