cypress-browserify-preprocessor icon indicating copy to clipboard operation
cypress-browserify-preprocessor copied to clipboard

`babelify` should not be removed when `.typescript` is set

Open ben8p opened this issue 4 years ago • 0 comments

  • Operating System: Ubuntu 18.04
  • Cypress Version: 6.1.0
  • Browser Version: Chrome 87.0.4280.88

Is this a Feature or Bug?

This is a bug

Current behavior:

When .typescript option is set, babelify is removed from the transforms.
As a result, if the typescript file is dependent on a JS module using ES6, the transpilation will fail.

Desired behavior:

babelify should not be removed when using typescript as it may still be useful, as described here: https://github.com/cypress-io/cypress-browserify-preprocessor/issues/19

the line browserifyOptions.transform = transform.filter((stage) => !Array.isArray(stage) || !stage[0].includes('babelify')) should be changed accordingly

How to reproduce:

  • write a typscript file with a depdency to a JS es6 module
  • run the code

it crash

Additional Info (images, stack traces, etc)

ben8p avatar Jan 08 '21 13:01 ben8p