【问题标题】:When using loaders with webpack, are there any differences in referring to the loader with the "-loader" postfix?当使用带有 webpack 的加载器时,使用“-loader”后缀引用加载器有什么不同吗?
【发布时间】:2015-08-14 06:09:27
【问题描述】:

我见过不同的例子,比如这两个:

  1. An example showing the "-loader" postfix after the style and css loaders,

  2. Another including the loaders without the "-loader" postfix.

我已经对其进行了测试,它似乎在这两种情况下都有效。 webpack 会测试并包含它吗?

【问题讨论】:

    标签: webpack


    【解决方案1】:

    这没什么区别。

    过去这是有问题的。如果您同时安装了csscss-loader,则在使用loader: 'css' 类型的定义时可能无法加载。这似乎不再是问题了。

    resolveLoader.moduleTemplates 可用于在需要时详细控制此行为。

    【讨论】:

      猜你喜欢
      • 2019-03-05
      • 2019-07-28
      • 2019-05-07
      • 2016-09-23
      • 1970-01-01
      • 1970-01-01
      • 2021-08-04
      • 2018-12-27
      • 2016-01-23
      相关资源
      最近更新 更多