Feature Request
Is your feature request related to a problem?
This is a feature requested based on this issue.
I would like babel to have an option to embed the entire @babel/runtime in the transpiled code so no external dependencies are needed to run the code.
It is possible to embed some of the runtime by setting the flag helpers to false.
However, no option exist to embed the entire runtime.
Describe the solution you'd like
That @babel/plugin-transform-runtime accepts a new option called embed.
When set to true, babel will automatically embed all external dependencies in the transpiled code:
{ "plugins": [ [ "@babel/plugin-transform-runtime", { "embed": true } ] ] }
Describe alternatives you've considered.
It is possible to embed the dependencies yourself by using a bundler like webpack.
However this adds unnecessary complexity for a simple project.
Documentation, Adoption, Migration Strategy
If you can, explain how users will be able to use this and how it might be documented. Maybe a mock-up?
embed
boolean, defaults to false.
Tells babel whether or not to embed all runtime dependencies.
If set to true babel will create output code that does not depend on any external dependencies.
Feature Request
Is your feature request related to a problem?
This is a feature requested based on this issue.
I would like babel to have an option to embed the entire
@babel/runtimein the transpiled code so no external dependencies are needed to run the code.It is possible to embed some of the runtime by setting the flag
helperstofalse.However, no option exist to embed the entire runtime.
Describe the solution you'd like
That
@babel/plugin-transform-runtimeaccepts a new option calledembed.When set to
true, babel will automatically embed all external dependencies in the transpiled code:{ "plugins": [ [ "@babel/plugin-transform-runtime", { "embed": true } ] ] }Describe alternatives you've considered.
It is possible to embed the dependencies yourself by using a bundler like
webpack.However this adds unnecessary complexity for a simple project.
Documentation, Adoption, Migration Strategy
If you can, explain how users will be able to use this and how it might be documented. Maybe a mock-up?
embedboolean, defaults tofalse.Tells babel whether or not to embed all runtime dependencies.
If set to
truebabel will create output code that does not depend on any external dependencies.