willyelm / pug-html-loader

Pug HTML loader for webpack

Home Page:https://github.com/willyelm/pug-html-loader

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Replace parseQuery() with getOptions()

bstuff opened this issue · comments

I use webpack2.

module: {
    loaders: [
...
        test:   /\.(pug|jade)$/,
        loaders: [
          {
            loader: 'html-loader',
            options: {
              interpolate: true,
              attrs: 'img:src xlink:href source:src image:xlink:href',
            },
          },
          {
            loader: 'pug-html-loader',
            options: {
              exports: false,
              basedir: __dirname,
            },
          },
        ],
...
  ],
},

causes (node:91943) DeprecationWarning: loaderUtils.parseQuery() received a non-string value which can be problematic, see webpack/loader-utils#56
parseQuery() will be replaced with getOptions() in the next major version of loader-utils.

while

module: {
    loaders: [
...
        test:   /\.(pug|jade)$/,
        loaders: [
          'html?attrs=img:src xlink:href source:src image:xlink:href&interpolate',
          'pug-html?exports=false&basedir='+__dirname,
        ],
...
  ],
},

is ok

warning should be gone on the latest version