【问题标题】:Error when test jquery dependenci on Laravel Mix or Encore webpack在 Laravel Mix 或 Encore webpack 中测试 jquery 依赖项时出错
【发布时间】:2020-11-04 23:06:03
【问题描述】:

在我的项目中,我使用 vuejs 而不是 jquery。测试 jquery 时,webpack encore 返回错误。下面是输出代码和错误的示例js。

我的 js:

if (typeof jQuery! == "undefined" && typeof jQuery.fn! == "undefined") {
console.log ("jquery is in the project");
} From others {
console.log ("jquery is not in the project");
}

输出错误:

未找到此依赖项:

jquery

我并没有真正使用jquery,所以我的console.log应该生成“jquery不在项目中”

还有另一种测试jquery的方法吗?

【问题讨论】:

    标签: jquery laravel webpack laravel-mix


    【解决方案1】:

    我解决了这个问题,问题出在 webpack.config.js 中,我使用的是 .autoProvidejQuery() 但我没有使用 jquery,所以我评论了这一行

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2017-06-23
      • 2017-11-22
      • 2019-04-05
      • 2017-12-03
      • 1970-01-01
      • 2017-12-05
      • 1970-01-01
      • 2018-10-24
      相关资源
      最近更新 更多