如何禁用预加载器?

时间:2016-08-15 18:41:31

标签: webpack

我已经设置了jshinting with webpack,但我希望将特定文件作为javascript加载而不需要它。我的jshint设置为 preLoader

  module: {
    preLoaders: [
      {
        test: /\.js$/, // include .js files
        exclude: /node_modules/, // exclude any and all files in the node_modules folder
        loader: "jshint-loader"
      }
    ]
  },

我试图像这样禁用这个预加载器:

require('!script!../../lib/bootstrap');

因为the documentation声明:

  

添加!对请求将禁用已配置的预加载器   要求("!原料./ script.coffee&#34)

然而,当我这样做时,文件仍然是linted:

  警告在./~/script-loader/~/raw-loader!./~/jshint-loader!。/ lib / bootstrap.js   jshint导致错误...

如果我使用此要求:

require('!!script!../../lib/bootstrap');

不会发生掉毛。

这里发生了什么以及为什么我不能使用推荐的禁用预加载器的方法禁用此预加载器?

0 个答案:

没有答案