cypress-browserify-preprocessor
cypress-browserify-preprocessor copied to clipboard
How to better add individual babel plugins?
I am trying to transpile spec that has
it('transpiles Object.fromEntries', () => {
// https://github.com/tc39/proposal-object-from-entries
const obj = Object.fromEntries([['a', 0], ['b', 1]])
})
I am trying to modify babel preset-env options via preprocessor to add useBuiltIns https://babeljs.io/docs/en/next/babel-preset-env#usebuiltins but nothing seems to work. I think a few more examples of adding support for specific babel transforms would be nice.
In general, I think a good question to answer in our docs would be:
Should users push Babel plugins into default options?
Or should they add them to .babelrc file and enable babelrc options?
Babel 7.0 itself uses babel.config.js to configure plugins. @cypress/browserify-preprocessor doesn't obey babel.config.js, but I think it should. Other similar adapters like babel-jest do this.