Description
I'm working on a project that uses both Babel and TypeScript. It has a dangerfile written in TypeScript that imports a JavaScript file. That JS file in turn imports a JS file from a package in node_modules
. The issue is that the JS file uses the new
keyword to instantiate an ES6 class defined in the JS file from the package. Danger uses Babel to transpile the file to ES5. The transpiled code doesn't use new
to instantiate the ES6 class (which isn't transpiled because it's in node_modules
), leading to a Class constructor ClassName cannot be invoked without 'new'
error.
I know that there's a way to disable all transpilation. However, I want to keep transpiling TypeScript so that I can write the dangerfile in TypeScript. It would be useful to just be able to disable Babel transpilation while continuing to transpile TypeScript (or maybe vice versa for a different use case).
Activity