cypress + lerna: ParseError: 'import' and 'export' may appear only with 'sourceType: module'
cypress + lerna: ParseError: 'import' and 'export' may appear only with 'sourceType: module'
我目前开始使用 cypress。在测试中,我想从另一个模块导入代码,但它说 ParseError: 'import' and 'export' may appear only with 'sourceType: module'
.
我已经像描述的那样添加了预处理器 here。
Here 是一个不起作用的回购协议。 Cypress 在模块 a
中并从模块 b
.
中导入一个函数
您需要在您的项目中实际安装预处理器,而不仅仅是它的对等依赖项:npm install --save-dev @cypress/webpack-preprocessor
我目前开始使用 cypress。在测试中,我想从另一个模块导入代码,但它说 ParseError: 'import' and 'export' may appear only with 'sourceType: module'
.
我已经像描述的那样添加了预处理器 here。
Here 是一个不起作用的回购协议。 Cypress 在模块 a
中并从模块 b
.
您需要在您的项目中实际安装预处理器,而不仅仅是它的对等依赖项:npm install --save-dev @cypress/webpack-preprocessor