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

Cannot add plug-syntax-flow

Open frankhli843 opened this issue 5 years ago • 0 comments

Love cypress! Thanks in advance

I have the following configuration

// https://github.com/cypress-io/cypress-browserify-preprocessor#modifying-default-options
/**
 * This to modify Cypress web pack
 */
const browserify = require('@cypress/browserify-preprocessor')

module.exports = (on) => {
  const options = {
    extensions: ['.js', '.jsx', '.coffee'],
    transform: [
      [
        'coffeeify',
        {}
      ],
      [
        'babelify',
        {
          ast: false,
          babelrc: false,
          plugins: [
            '@babel/plugin-transform-modules-commonjs',
            '@babel/plugin-proposal-class-properties',
            '@babel/plugin-proposal-object-rest-spread',
            '@babel/plugin-transform-runtime',
            '@babel/plugin-syntax-flow'
          ],
          presets: [
            '@babel/preset-env',
            '@babel/preset-react',
            '@babel/preset-flow'
          ]
        },
      ]
    ],
    debug: true,
    plugin: [],
    cache: {},
    packageCache: {}
  }

  on('file:preprocessor', browserify(options))
}

in cypress/plugins/browsify.js

but still see the error image

frankhli843 avatar Oct 19 '20 21:10 frankhli843