-
-
Notifications
You must be signed in to change notification settings - Fork 455
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Fixed some erroneous logic in the router, since it's now being used in the response handler - Mocked console errors in tests
- Loading branch information
Showing
10 changed files
with
104 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,32 @@ | ||
import commonjs from "@rollup/plugin-commonjs"; | ||
import typescript from "@rollup/plugin-typescript"; | ||
import { nodeResolve } from "@rollup/plugin-node-resolve"; | ||
import externals from "rollup-plugin-node-externals"; | ||
|
||
export default { | ||
input: "./src/default-handler.ts", | ||
const LOCAL_EXTERNALS = [ | ||
"./manifest.json", | ||
"./routes-manifest.json", | ||
"./prerender-manifest.json" | ||
]; | ||
const NPM_EXTERNALS = ["aws-lambda", "aws-sdk/clients/s3"]; | ||
|
||
const generateConfig = (filename) => ({ | ||
input: `./src/${filename}.ts`, | ||
output: { | ||
file: "dist/default-handler.js", | ||
file: `./dist/${filename}.js`, | ||
format: "cjs" | ||
}, | ||
plugins: [ | ||
commonjs(), | ||
externals({ | ||
exclude: "@sls-next/next-aws-cloudfront" | ||
}), | ||
nodeResolve(), | ||
typescript({ | ||
tsconfig: "tsconfig.bundle.json" | ||
}) | ||
], | ||
external: [ | ||
"util", | ||
"aws-lambda", | ||
"./manifest.json", | ||
"aws-sdk/clients/s3", | ||
"./routes-manifest.json", | ||
"./prerender-manifest.json" | ||
] | ||
}; | ||
external: [...NPM_EXTERNALS, ...LOCAL_EXTERNALS] | ||
}); | ||
|
||
export default ["default-handler", "api-handler"].map(generateConfig); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters