赛普拉斯-错误:找不到模块'../../webpack.config.js'

时间:2020-03-30 19:44:55

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

当我尝试运行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")
    }
  },

所以我不确定这是怎么回事,而且我几乎没有得到别名。我该如何在此处设置正确的路径。...

1 个答案:

答案 0 :(得分:1)

根据您的完整路径,我认为您需要将def substrings(*args, dictionary) words = args.map(&:split).flatten words.each { |word| puts word } end substrings("below as above", "foo is not a bar", dictionary) # output: # below # as # above # foo # is # not # a # bar 更改为require