Skip to content

docs(plugin-transform-runtime): add Node.js application usage example#3209

Open
derinbarutcu17 wants to merge 1 commit into
babel:mainfrom
derinbarutcu17:docs/transform-runtime-node-example-7357
Open

docs(plugin-transform-runtime): add Node.js application usage example#3209
derinbarutcu17 wants to merge 1 commit into
babel:mainfrom
derinbarutcu17:docs/transform-runtime-node-example-7357

Conversation

@derinbarutcu17

Copy link
Copy Markdown

Summary

Closes babel/babel#7357

Adds a concrete, step-by-step code example showing how to use @babel/plugin-transform-runtime in a Node.js application using @babel/register.

The existing docs cover config file, CLI, and bare Node API usage — but there was no example showing the common real-world pattern of using @babel/register with the plugin in a running Node app.

What was added

A new "In a Node.js application" subsection under the Usage → Via Node API heading, covering:

  1. Installing all required packages (@babel/register, @babel/runtime, etc.)
  2. Creating babel.config.json with the plugin
  3. Creating a register.js entry point that hooks into Node's require
  4. Running the app with node register.js

Also includes a tip about pre-compiling for production use.

Motivation

This was a long-standing gap in the docs (babel/babel#7357, opened 2018). Developers integrating Babel into Node.js apps repeatedly hit this use case and couldn't find a concrete example in the official docs.

@netlify

netlify Bot commented Jun 5, 2026

Copy link
Copy Markdown

👷 Deploy request for babel-next pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit 23c72c0

@netlify

netlify Bot commented Jun 5, 2026

Copy link
Copy Markdown

Deploy Preview for babel ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit 23c72c0
🔍 Latest deploy log https://app.netlify.com/projects/babel/deploys/6a2328c40bab8e000773cbc5
😎 Deploy Preview https://deploy-preview-3209--babel.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

injecting external-helpers in a node app

1 participant