Skip to content

Commit

Permalink
fix: s3 upload file paths fix
Browse files Browse the repository at this point in the history
  • Loading branch information
danielcondemarin committed Apr 3, 2019
1 parent ca4ce9b commit 7e19f03
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion __tests__/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ describe("ServerlessNextJsPlugin", () => {

return plugin.uploadStaticAssets().then(() => {
expect(uploadStaticAssetsToS3).toBeCalledWith({
staticAssetsPath: path.join(distDir, "static"),
staticAssetsPath: path.join("/path/to/next", distDir, "static"),
bucketName: "my-bucket",
providerRequest: expect.any(Function)
});
Expand Down
6 changes: 5 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,11 @@ class ServerlessNextJsPlugin {
}

return uploadStaticAssetsToS3({
staticAssetsPath: path.join(nextConfiguration.distDir, "static"),
staticAssetsPath: path.join(
this.nextConfigDir,
nextConfiguration.distDir,
"static"
),
providerRequest: this.providerRequest,
bucketName: staticAssetsBucket
});
Expand Down

0 comments on commit 7e19f03

Please sign in to comment.