KiaraGrouwstra / pug-plugin-ng

A Pug plugin allowing unquoted use of Angular 2's `[(bananabox)]="val"` syntax
MIT License
24 stars 2 forks source link

Webpack 2 allows objects as queries #1

Closed chrisnicola closed 8 years ago

chrisnicola commented 8 years ago

With webpack 2 the following configuration works.

      {
        test: /\.pug/,
        include: helpers.root('modules'),
        loader: 'pug-html', 
        query: { plugins: [require('pug-plugin-ng')] },
      },

If you have multiple loaders chained it can be written like this.

      {
        test: /\.pug/,
        include: helpers.root('modules'),
        loaders: [
          { loader: 'html', query: { root: 'images' } },
          { loader: 'pug-html', query: { plugins: [require('pug-plugin-ng')] }},
        ]
      },

Figured you might want to add that to the docs.

KiaraGrouwstra commented 8 years ago

So essentially out of the box huh? I'll add that, thanks! :)

chrisnicola commented 8 years ago

Pretty much. Though I can't get the html loader to work with the output from pug-html-loader. I think it is an issue with html-loader though. One battle at a time I guess.

KiaraGrouwstra commented 8 years ago

Yeah, tell me about it... I'm glad this obsolifies that pug-ng-html-loader, but I wish Ionic 2 RC wouldn't have further complicated Pug use. :(