Allow using custom config in babel-node --eval#16642
Merged
nicolo-ribaudo merged 7 commits intobabel:mainfrom Jul 26, 2024
Merged
Allow using custom config in babel-node --eval#16642nicolo-ribaudo merged 7 commits intobabel:mainfrom
babel-node --eval#16642nicolo-ribaudo merged 7 commits intobabel:mainfrom
Conversation
Collaborator
|
Build successful! You can test your changes in the REPL here: https://babeljs.io/repl/build/57448 |
1 task
JLHwung
reviewed
Jul 14, 2024
Co-authored-by: Huáng Jùnliàng <jlhwung@gmail.com>
Closed
1 task
Contributor
|
@slatereax |
Member
|
@JLHwung I added two tests, please take a look! |
Contributor
Thanks, in #11877 we do load configs but they are not passed to the eval transform so the new tests are actually passing on the main branch. Can you add a simple plugin to manipulate the input source? So that we are sure the resolved config is applied. |
Member
|
Done! |
JLHwung
approved these changes
Jul 25, 2024
babel-node --eval
This was referenced Oct 5, 2024
This was referenced Oct 8, 2024
This was referenced Oct 24, 2024
This was referenced Oct 24, 2024
This was referenced Oct 25, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Transform code for
babel-nodeeval does not use the options that were passed in the cli flags. Also,replPlugin, which is used for code transformation, only allowsvarvariables, although modern versions of node repl supportletandconst.Based on the history of this file, it appears that this code was written in 2017 when node did not support any variables other than var, but there is no need for this check now. If anyone needs to use babel-node with node < 6.0.0, they can pass their configuration file through --config-file.