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

Bump node target #4257

Closed
wants to merge 5 commits into from
Closed
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
7 changes: 4 additions & 3 deletions babel.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@ const path = require('path')

const packageJSON = require(path.join(__dirname, 'package.json'))

// RedwoodJS targets Node.js 12.x because this is the default version
// for Netlify's functions.
const TARGETS_NODE = '12.16'
// RedwoodJS targets Node.js 14.x because it's the default version for Netlify and Vercel's functions:
// - https://docs.netlify.com/functions/build-with-javascript/#runtime-settings
// - https://vercel.com/docs/runtimes#official-runtimes/node-js/node-js-version
const TARGETS_NODE = '14.20'

// Run `npx browserslist "defaults, not IE 11, not IE_Mob 11"` to see a list
// of target browsers.
Expand Down
2 changes: 1 addition & 1 deletion packages/internal/src/build/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ export const transpileApi = (files: string[], options = {}) => {
absWorkingDir: rwjsPaths.api.base,
entryPoints: files,
platform: 'node',
target: 'node12', // Netlify defaults NodeJS 12: https://answers.netlify.com/t/aws-lambda-now-supports-node-js-14/31789/3
target: 'node14', // Netlify defaults NodeJS 14: https://answers.netlify.com/t/aws-lambda-now-supports-node-js-14/31789/3
format: 'cjs',
bundle: false,
outdir: rwjsPaths.api.dist,
Expand Down
5 changes: 4 additions & 1 deletion packages/internal/src/build/babel/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,10 @@ import {
getCommonPlugins,
} from './common'

const TARGETS_NODE = '12.16'
// RedwoodJS targets Node.js 14.x because it's the default version for Netlify and Vercel's functions:
// - https://docs.netlify.com/functions/build-with-javascript/#runtime-settings
// - https://vercel.com/docs/runtimes#official-runtimes/node-js/node-js-version
const TARGETS_NODE = '14.20'
// Warning! Use the minor core-js version: "corejs: '3.6'", instead of "corejs: 3",
// because we want to include the features added in the minor version.
// https://github.com/zloirock/core-js/blob/master/README.md#babelpreset-env
Expand Down