Skip to content
This repository has been archived by the owner on May 22, 2024. It is now read-only.

feat: reinstate ESM transpilation for NFT #790

Merged
merged 10 commits into from
Nov 4, 2021
Merged

Conversation

eduardoboucas
Copy link
Member

- Summary

Reinstates ESM transpilation when using NFT, which was temporarily disabled in #786. It's sitting behind a nftTranspile feature flag.

Unlike the initial implementation introduced by #759, this PR only transpiles a file to ESM (and patches any corresponding package.json) if all its parents are ESM files themselves, also candidates for transpilation.

- Test plan

Existing tests adjusted accordingly.

- A picture of a cute animal (not mandatory but encouraged)

gettyimages-144862048

@eduardoboucas eduardoboucas added the type: feature code contributing to the implementation of a feature and/or user facing functionality label Nov 4, 2021
src/runtimes/node/bundlers/nft/es_modules.ts Outdated Show resolved Hide resolved
tests/main.js Outdated Show resolved Hide resolved
src/runtimes/node/bundlers/nft/es_modules.ts Outdated Show resolved Hide resolved
eduardoboucas and others added 3 commits November 4, 2021 13:25
Co-authored-by: Netlify Team Account 1 <90322326+netlify-team-account-1@users.noreply.github.com>
Co-authored-by: Netlify Team Account 1 <90322326+netlify-team-account-1@users.noreply.github.com>
eduardoboucas and others added 2 commits November 4, 2021 13:56
Co-authored-by: Netlify Team Account 1 <90322326+netlify-team-account-1@users.noreply.github.com>
@eduardoboucas eduardoboucas merged commit 6a9a9f8 into main Nov 4, 2021
@eduardoboucas eduardoboucas deleted the feat/nft-esm-transpile branch November 4, 2021 14:51
Skn0tt pushed a commit to netlify/build that referenced this pull request May 21, 2024
…#790)

* feat: reinstate ESM transpilation for NFT

* chore: add check for Node version

* chore: add comment

* chore: doh

* chore: simplify Node version check

Co-authored-by: Netlify Team Account 1 <90322326+netlify-team-account-1@users.noreply.github.com>

* refactor: simplify Map initialisation

Co-authored-by: Netlify Team Account 1 <90322326+netlify-team-account-1@users.noreply.github.com>

* refactor: fix `shouldTranspile`

* refactor: make `shouldTranspile` read from cache

* refactor: use non-null assertion operator

Co-authored-by: Netlify Team Account 1 <90322326+netlify-team-account-1@users.noreply.github.com>

* refactor: remove non-null assertion operator

Co-authored-by: Netlify Team Account 1 <90322326+netlify-team-account-1@users.noreply.github.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
type: feature code contributing to the implementation of a feature and/or user facing functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants