Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove netlify-lambda from build process #11490

Merged
merged 1 commit into from
Oct 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 0 additions & 15 deletions gatsby-node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -495,18 +495,3 @@ export const onPreBootstrap: GatsbyNode["onPreBootstrap"] = async ({
copyContributors()
reporter.info(`Contributors copied`)
}

// Build lambda functions when the build is complete and the `/public` folder exists
export const onPostBuild: GatsbyNode["onPostBuild"] = async (
gatsbyNodeHelpers
) => {
const { reporter } = gatsbyNodeHelpers

const reportOut = (report: { stderr: string; stdout: string }) => {
const { stderr, stdout } = report
if (stderr) reporter.error(stderr)
if (stdout) reporter.info(stdout)
}

reportOut(await exec("npm run build:lambda && cp netlify.toml public"))
}
8 changes: 5 additions & 3 deletions netlify.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,13 @@
# Default build command.
# command = "yarn build" # debug with: "yarn build --verbose"

# Directory with the serverless Lambda functions to deploy to AWS.
# netlify-lambda needs this netlify.toml file in order to build
# Directory with the serverless Lambda functions to deploy to AWS
functions = "public/functions"

[[headers]]
for = "/*"
[headers.values]
Access-Control-Allow-Origin = "https://esp.ethereum.foundation"
Access-Control-Allow-Origin = "https://esp.ethereum.foundation"

[[plugins]]
package = "@netlify/plugin-gatsby"
4 changes: 1 addition & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@
"is-relative-url": "^3.0.0",
"lodash": "^4.17.21",
"luxon": "^1.28.1",
"netlify-lambda": "^2.0.3",
"polished": "^4.1.4",
"prism-react-renderer": "^1.1.1",
"prismjs": "^1.27.0",
Expand All @@ -83,6 +82,7 @@
"@chakra-ui/cli": "^2.4.1",
"@chakra-ui/storybook-addon": "^5.0.1",
"@netlify/functions": "^1.2.0",
"@netlify/plugin-gatsby": "^3.7.2",
"@storybook/addon-a11y": "^7.0.23",
"@storybook/addon-actions": "^7.0.23",
"@storybook/addon-essentials": "^7.0.23",
Expand Down Expand Up @@ -121,7 +121,6 @@
"scripts": {
"postinstall": "yarn theme",
"build": "gatsby build",
"build:lambda": "cross-env NODE_OPTIONS=--openssl-legacy-provider netlify-lambda build src/lambda --config=./webpack.lambda.js",
"build:10gb": "cross-env NODE_OPTIONS=--max-old-space-size=10240 gatsby build",
"clean": "gatsby clean",
"crowdin-clean": "rm -rf .crowdin && mkdir .crowdin",
Expand All @@ -134,7 +133,6 @@
"optimize-images": "ts-node -O '{ \"module\": \"commonjs\" }' src/scripts/optimizeImages.ts",
"crowdin-contributors": "ts-node -O '{ \"module\": \"commonjs\" }' src/scripts/crowdin/getCrowdinContributors.ts",
"start": "gatsby develop",
"start:lambda": "netlify-lambda serve src/lambda",
"start:static": "gatsby build && gatsby serve",
"serve": "gatsby serve",
"type-check": "tsc --noEmit",
Expand Down
29 changes: 0 additions & 29 deletions webpack.lambda.js

This file was deleted.

Loading
Loading