所以我遇到了一个问题,类似于这里的问题:https://github.com/cypress-io/cypress/issues/16188
在 Cypress 和 tsconfig.json
中,路径/baseURL 设置如下:
"baseUrl": ".",
"paths": {
"*": [
"node_modules/*",
"app/packs/*"
]
会导致错误:
TypeError: validateOptions is not a function
at new SourceMapDevToolPlugin
删除 baseURL
部分或 node_modules/*
部分可以解决问题。但是,我不确定为什么。我对 TypeScript 或 webpack 并不完全满意,但删除 node_modules/*
部分似乎不会影响 Web 应用程序(我想删除 baseURL
会导致一些问题)。但我不确定是否有我不知道的副作用?
我的猜测是 Cypress 正在使用 tsconfig.json
来查找包并且正在查看错误的 node_modules
路径....但是从其中删除 node_modules/*
是否安全路径还是我错过了一些重要的东西?