-
Notifications
You must be signed in to change notification settings - Fork 18
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
Provide an option to parse a file as a script. #175
Labels
Comments
eventualbuddha
added a commit
that referenced
this issue
Nov 24, 2018
Previously babel-codemod hardcoded a value of `module` for the source type when parsing. This meant that any code not valid in strict mode could not be processed. Now babel-codemod uses a default source type of `unambiguous`, which means that babel will try to infer the source type. Additionally, this source type can be overridden with the `--source-type` option. Closes #175
eventualbuddha
added a commit
that referenced
this issue
Nov 24, 2018
Previously babel-codemod hardcoded a value of `module` for the source type when parsing. This meant that any code not valid in strict mode could not be processed. Now babel-codemod uses a default source type of `unambiguous`, which means that babel will try to infer the source type. Additionally, this source type can be overridden with the `--source-type` option. Closes #175
🎉 This issue has been resolved in version 2.1.0 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
Thanks for the suggestion! This should hopefully just work as-is if you update to v2.1.0, but you also have the option to specify the source type if you have to. |
Thanks for this! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I am creating a codemod for converting a script into a module while retaining the same behaviour - the idea is to use it to integrate legacy scripts into a webpack build.
However, the issue is that the
sourceType
option to babel's parser is hardcoded to'module'
in this library, when I need it to parsed as a script.Could this be added as an option to the CLI?
The text was updated successfully, but these errors were encountered: