【问题标题】:Is it possible to exclude jquery from jquery dependent plugins in bundle?是否可以从捆绑中的 jquery 依赖插件中排除 jquery?
【发布时间】:2019-05-22 10:01:01
【问题描述】:

我捆绑了 jQuery 和其他一些全局插件。 我还捆绑了“fancybox”插件,捆绑了“swiper”插件。 (它们是 jQuery 插件,但不包括 jQuery 并且在我的 jQuery 包上工作)

但是,“tooltipster”插件包,包括它自己的 jQuery。与“jquery-validation”插件相同...

我怎样才能避免这种情况?

【问题讨论】:

    标签: jquery webpack webpack-4


    【解决方案1】:

    突然,我在 webpack 配置中找到了解决方案。

        externals: {
            jquery: 'jQuery'
        },
    

    https://webpack.js.org/configuration/externals/

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2013-09-26
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-07-01
      • 2021-07-12
      相关资源
      最近更新 更多