Automatic Babel Transformation problematic
See original GitHub issueHey Orta!
Thanks for all your hard work on Danger. Fantastic tool š.
Iām running into an issue with the automatic Babel transformation that I wanted to discuss with you and any other collaborators before submitting a Pull Request.
My project is a pretty standard webpack/babel compiled front-end application. Iām running Danger on node 8.x, so I really do not need Babel transformation of my dangerfile
.
Right now, because of my babel-preset-env
config for builds targeting web browsers, template literals in my dangerfile
are being compiled to ES5. This would be fine, except my .babelrc
is setup to use transform-runtime
. This is problematic because Babel 6 has a bug where transform-runtime
injects import declarations rather than require
calls. After this happens, Danger fails on calls to nodeās module._compile
.
I can work around this issue by moving everything in my Babel config to use the env
feature temporarily, and have no ādefaultā babel config. However, Iām concerned that the automatic Babel transformation in Danger without an opt-out is a bit heavy-handed.
Would you be willing to accept a PR that disables Babel/TypeScript transformation?
Issue Analytics
- State:
- Created 5 years ago
- Reactions:2
- Comments:20 (14 by maintainers)
Top GitHub Comments
Just to chime in, the default example of setting up an action with the following gets the same
Error: Cannot find module '@babel/plugin-transform-flow-strip-types' from '/github/workspace'
error. Sounds like itās the same issue?@brandonjmckay Setting
DANGER_DISABLE_TRANSPILATION="true"
env var fixed it for me.