Cypress ParseError: 'import' and 'export' may appear only with 'sourceType: module'

后端 未结 5 1357
星月不相逢
星月不相逢 2021-01-11 14:56

I updated Cypress from 3.0.3 to 3.1.3. Im using ES6 import/export modules which must be working related to docs. But Im getting a line with u

5条回答
  •  别那么骄傲
    2021-01-11 15:44

    When using @vue/cli you can simply do (which is commented in Cypress /plugins/index.js):

    const webpack = require('@cypress/webpack-preprocessor');
    
    module.exports = (on, config) => {
        on('file:preprocessor', webpack({
            webpackOptions: require('@vue/cli-service/webpack.config'),
            watchOptions: {},
        }));
    };
    

提交回复
热议问题