Skip to content
This repository was archived by the owner on Jan 28, 2025. It is now read-only.

Commit c56f775

Browse files
Xiphedanielcondemarin
authored andcommitted
Use "./" as default value for nextConfigDir (#70)
* feat(config): use "./" as default value for nextConfigDir
1 parent 620b264 commit c56f775

File tree

7 files changed

+3
-17
lines changed

7 files changed

+3
-17
lines changed

README.md

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -80,10 +80,6 @@ Edit the serverless.yml and add:
8080
plugins:
8181
- serverless-nextjs-plugin
8282

83-
custom:
84-
serverless-nextjs:
85-
nextConfigDir: "./"
86-
8783
package:
8884
exclude:
8985
- ./**
@@ -115,7 +111,6 @@ plugins:
115111
116112
custom:
117113
serverless-nextjs:
118-
nextConfigDir: "./"
119114
assetsBucketName: "your-bucket-name"
120115
```
121116

@@ -126,7 +121,6 @@ If you need the static assets available in the main domain of your application,
126121
```yml
127122
custom:
128123
serverless-nextjs:
129-
nextConfigDir: ./
130124
staticDir: ./assets
131125
routes:
132126
- src: ./assets/robots.txt
@@ -178,7 +172,6 @@ plugins:
178172
179173
custom:
180174
serverless-nextjs:
181-
nextConfigDir: ./
182175
pageConfig:
183176
about:
184177
memorySize: 512 # default is 1024
@@ -204,7 +197,6 @@ plugins:
204197
205198
custom:
206199
serverless-nextjs:
207-
nextConfigDir: ./
208200
pageConfig:
209201
"*":
210202
layers:
@@ -249,7 +241,6 @@ plugins:
249241
250242
custom:
251243
serverless-nextjs:
252-
nextConfigDir: ./
253244
routes:
254245
- src: post
255246
path: posts/{slug}
@@ -296,7 +287,6 @@ plugins:
296287

297288
custom:
298289
serverless-nextjs:
299-
nextConfigDir: ./
300290
customHandler: ./handler.js
301291
```
302292
@@ -322,7 +312,7 @@ module.exports = page => {
322312

323313
| Plugin config key | Default Value | Description |
324314
| ----------------- | ------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
325-
| nextConfigDir | \<empty\> | Path to parent directory of `next.config.js`. |
315+
| nextConfigDir | './' | Path to parent directory of `next.config.js`. |
326316
| assetsBucketName | \<empty\> | Creates an S3 bucket with the name provided. The bucket will be used for uploading next static assets. |
327317
| staticDir | \<empty\> | Directory with static assets to be uploaded to S3, typically a directory named `static`, but it can be any other name. Requires a bucket provided via the `assetPrefix` described above or the `assetsBucketName` plugin config. |
328318
| routes | [] | Array of custom routes for the next pages or static assets. |

examples/app-with-custom-lambda-handler/serverless.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ plugins:
1313

1414
custom:
1515
serverless-nextjs:
16-
nextConfigDir: ./
1716
customHandler: ./my-lambda-handler.js
1817

1918
package:

examples/basic-next-serverless-app/serverless.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ plugins:
1414

1515
custom:
1616
serverless-nextjs:
17-
nextConfigDir: ./
1817
staticDir: ./assets
1918
routes:
2019
- src: ./assets/robots.txt

index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ class ServerlessNextJsPlugin {
4646
getPluginConfigValue(param) {
4747
const defaults = {
4848
routes: [],
49+
nextConfigDir: "./",
4950
uploadBuildAssets: true
5051
};
5152

integration/app-with-serverless-offline/serverless.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ plugins:
1010

1111
custom:
1212
serverless-nextjs:
13-
nextConfigDir: ./
1413
routes:
1514
- src: post
1615
path: post/{slug}

integration/basic-app/serverless.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ plugins:
1111

1212
custom:
1313
serverless-nextjs:
14-
nextConfigDir: ./
1514
pageConfig:
1615
post:
1716
memorySize: 2048

lib/__tests__/getAssetsBucketName.test.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ describe("getAssetsBucketName", () => {
3232

3333
const pluginWithoutBucket = new ServerlessPluginBuilder()
3434
.withPluginConfig({
35-
nextConfigDir: "./",
3635
staticDir: "./static"
3736
})
3837
.build();
@@ -46,7 +45,7 @@ describe("getAssetsBucketName", () => {
4645
expect.assertions(2);
4746

4847
const bucketName = "bucket-123";
49-
const nextConfigDir = "./";
48+
const nextConfigDir = "./customConfigDir";
5049

5150
parseNextConfiguration.mockReturnValueOnce(
5251
parsedNextConfigurationFactory(

0 commit comments

Comments
 (0)