Skip to content

Plugins in posthtml.config.js only work with require('posthtml-plugin')() #2

@andreyvolokitin

Description

@andreyvolokitin

I am trying to keep all posthtml options in posthtml.config.js. I get empty-div output from posthtml-loader (<div></div>) when I use following notation in posthtml.config.js:

module.exports = {
  plugins: {
    'posthtml-include': {},
    'posthtml-mixins': {},
  },
};

but everything is working fine when I use notation with require():

module.exports = {
  plugins: [
    require('posthtml-include')({}),
    require('posthtml-mixins')({}),
  ],
};

Not sure if it is me doing something wrong, or it is a problem with posthtml-loader or posthtml-load-config

🌐 Environment

OS node npm/yarn package
[OS X][10.11.6] [9.2.1] [5.6.0] [1.0.1]

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions