【问题标题】:Cypress - Error: Cannot find module '../../webpack.config.js'赛普拉斯 - 错误:找不到模块'../../webpack.config.js'
【发布时间】:2020-07-11 06:44:51
【问题描述】:

当我尝试运行 cypress 时,一旦窗口打开“错误:找不到模块 '../../webpack.config.js'”,我就会收到错误消息

在我的插件>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")
    }
  },

所以我不确定出了什么问题,而且我几乎没有得到别名。我怎样才能在那里设置正确的路径....

【问题讨论】:

    标签: typescript webpack visual-studio-code alias cypress


    【解决方案1】:

    根据您的完整路径,我认为您需要将您的 require 更改为 require('../webpack.config.js')

    【讨论】:

      猜你喜欢
      • 2021-07-05
      • 2020-12-23
      • 2022-06-27
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-05-31
      • 1970-01-01
      相关资源
      最近更新 更多