WebPack编译错误与柏树 - 拖列库

发布于 2025-02-09 11:28:12 字数 2406 浏览 1 评论 0原文

我添加了 cypress-drag-drop library 在我的项目中,我与<<代码> Angular 。在本地,一切都可以正常工作,并且测试通过了。但是,当我在jenkins中运行测试时,它将显示下一个错误:

“在此处输入图像说明”

我已经配置我不明白为什么它显示此错误。

command.js中,我添加了:

”

package.json中:

我的tsconfig。 json

”在此处输入图像描述”

我试图在我的webpack.config.prod.js中添加一个别名,但它仍然失败。

module.exports = env => ({
  entry: path.resolve(__dirname, "src/root-config"),
  output: {
    filename: "root-config.js",
    libraryTarget: "system",
    path: path.resolve(__dirname, "dist")
  },
  devtool: "sourcemap",
  module: {
    rules: [
      { parser: { system: false } },
      {
        test: /\.js$/,
        exclude: /node_modules/,
        use: [{ loader: "babel-loader" }]
      }
    ]
  },
  resolve: {
    alias: {
      "@4tw": path.resolve(__dirname, "src")
    }
  },
  plugins: [
    new CopyWebpackPlugin([
      { from: path.resolve(__dirname, "src/favicon.ico"), to: "favicon.ico" },
      { from: path.resolve(__dirname, "img"), to: "img" },
      {
        from: path.resolve(__dirname, "src/importmap.json"),
        to: "importmap.json"
      },
      {
        from: path.resolve(__dirname, "node_modules/primeicons"),
        to: "primeicons"
      }
    ]),
    new HtmlWebpackPlugin({
      inject: false,
      template: "src/index.ejs",
      templateParameters: {
        isLocal: env && env.isLocal
      }
    }),
    new CleanWebpackPlugin()
  ],
  externals: ["single-spa", /^@monitor\/.+$/, "i18next"]
});

有人有这个错误吗?

I have added the cypress-drag-drop library in my project where I worked with Angular. In local, everything works fine and the tests passed. However, when I run the tests in Jenkins, it is displaying the next error:

enter image description here

I have configured how the readme.md said, so I don't understand why it is displaying this error.

In command.js, I have added:

enter image description here

In package.json:

enter image description here

My tsconfig.json:

enter image description here

I have tried to add an alias in my webpack.config.prod.js, but it is still failing.

module.exports = env => ({
  entry: path.resolve(__dirname, "src/root-config"),
  output: {
    filename: "root-config.js",
    libraryTarget: "system",
    path: path.resolve(__dirname, "dist")
  },
  devtool: "sourcemap",
  module: {
    rules: [
      { parser: { system: false } },
      {
        test: /\.js$/,
        exclude: /node_modules/,
        use: [{ loader: "babel-loader" }]
      }
    ]
  },
  resolve: {
    alias: {
      "@4tw": path.resolve(__dirname, "src")
    }
  },
  plugins: [
    new CopyWebpackPlugin([
      { from: path.resolve(__dirname, "src/favicon.ico"), to: "favicon.ico" },
      { from: path.resolve(__dirname, "img"), to: "img" },
      {
        from: path.resolve(__dirname, "src/importmap.json"),
        to: "importmap.json"
      },
      {
        from: path.resolve(__dirname, "node_modules/primeicons"),
        to: "primeicons"
      }
    ]),
    new HtmlWebpackPlugin({
      inject: false,
      template: "src/index.ejs",
      templateParameters: {
        isLocal: env && env.isLocal
      }
    }),
    new CleanWebpackPlugin()
  ],
  externals: ["single-spa", /^@monitor\/.+$/, "i18next"]
});

Does anybody has this error?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文