【问题标题】:How can I load the http resources by using the require method with webpack如何使用 webpack 的 require 方法加载 http 资源
【发布时间】:2017-03-30 08:20:06
【问题描述】:

我想通过在 js 文件中使用 require 和 webpack 来加载 http js 文件,而不是在视图页面中使用 script 标签,因为在文件加载之前必须配置一些必要的东西。代码如下: 要求(“http://xxxxx”); 但它不适用于 webpack,我该如何实现这个功能?

【问题讨论】:

    标签: http webpack require


    【解决方案1】:

    你不能require webpack 驻留在不同位置的外部文件。您必须使用诸如 jQuery / requirejs / script.js 之类的库来加载外部文件。

    【讨论】:

      猜你喜欢
      • 2022-10-30
      • 2016-03-11
      • 2016-04-19
      • 2021-06-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-07-04
      相关资源
      最近更新 更多