stocky-insurance-27750
02/13/2023, 4:05 PMModule parse failed: Unexpected token (1:0)
I've npm installed vue-loader and vue-loader-plugin and added this to the cypress.config.ts:
import preprocessor from '@cypress/webpack-preprocessor'
e2e: {
setupNodeEvents(on, config) {
const options = webpackPreprocessor.defaultOptions
options.webpackOptions.module.rules[0].use[0].options.presets.push('vue-loader')
on('file:preprocessor', webpackPreprocessor(options))
}
But get the error: Module parse failed: Unexpected token (21:12)
I get no errors if I'm not trying to import consts or have any webpack config in the cypress.config.ts.
Read this as 'adding to the default options' - https://github.com/cypress-io/cypress/tree/master/npm/webpack-preprocessor#modifying-default-options
We want to be able to handle .vue files and everything else continue as normal.
Any ideas?