当我尝试运行cypress时,一旦窗口打开,我就得到错误信息" error : Cannot find module '../../webpack.config.js'“
在我的plugins>index.js中,我在module.exports webpackOptions: require('../../webpack.config.js')中有这个。如果我将它更改为我的整个路径,它仍然有效。
完整路径: Users/username/projects/projA/tests/productA/cypress/webpack.config.js‘
在我的cypress>tsconfig.json中,我有:
"paths": {
"@app": [
"./"
]
}在我的cypress>webpack.config.js中,我有:
resolve: {
extensions: [".js", ".ts", ".d.ts", ".json"],
alias: {
'@app': path.resolve(__dirname, "./tests/nav.com/cypress")
}
},所以我不确定出了什么问题,而且我也不太明白别名。我怎样才能在那里设置正确的路径...
发布于 2020-03-31 05:22:06
根据您的完整路径,我认为您需要将require更改为require('../webpack.config.js')。
https://stackoverflow.com/questions/60938330
复制相似问题