Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[fix]: Using posthtml-cli with postcss autoprefixer #246

Open
mickeywu opened this issue May 18, 2017 · 2 comments
Open

[fix]: Using posthtml-cli with postcss autoprefixer #246

mickeywu opened this issue May 18, 2017 · 2 comments
Assignees
Labels
Milestone

Comments

@mickeywu
Copy link

I'm having problems using the CLI with PostCSS Autoprefixer. I already have posthtml-postcss and autoprefixer packages installed through NPM.

posthtml.json

{
  "posthtml": {
    "postcss": {},
    "plugins": {
      "autoprefixer": {
        "browsers": ["last 2 versions"]
      }
    }
  }
}

Running posthtml -i src/**/*.html -o posthtml/ -c posthtml.json gives me the following error:

(node:17883) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 79): Error: [object Object] is not a PostCSS plugin

After digging into the posthtml-postcss documentation (https://github.com/posthtml/posthtml-postcss), postcss expects a postcssPlugins argument (which is an array) before the usual options argument, as such:

posthtml([ postcss(postcssPlugins, postcssOptions, filterType) ])
    .process(html)
    .then((result) => console.log(result.html))

What is the proper way (if any) to pass in a list of plugins specifically for PostCSS through the CLI?

@Scrum Scrum self-assigned this May 23, 2017
@Scrum Scrum added the bug label May 23, 2017
@Scrum
Copy link
Member

Scrum commented May 23, 2017

@mickeywu Hi, thanks for feedback, Is associated with incorrect work post-load-plugins. I'm working on it.

@Scrum Scrum modified the milestones: 0.2.17, 0.3.0, 0.3.1 May 26, 2017
@Scrum Scrum changed the title Using posthtml-cli with postcss autoprefixer [fix]: Using posthtml-cli with postcss autoprefixer Jun 28, 2017
@Scrum Scrum modified the milestones: 0.3.1, 0.3.2 Oct 10, 2017
@Scrum Scrum modified the milestones: 0.3.2, 0.3.3 Jan 19, 2018
@Scrum
Copy link
Member

Scrum commented Jan 22, 2018

@mickeywu Hi, I fixed a rejection

(node:17883) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 79): Error: [object Object] is not a PostCSS plugin

but not resolves case with plugin posthtml-postcss((
I create issue what would fix it.

@Scrum Scrum modified the milestones: 0.3.3, 0.3.4, 0.4.2 Feb 14, 2018
@Scrum Scrum modified the milestones: 0.4.2, 0.4.3, 0.4.4 Feb 21, 2018
@Scrum Scrum modified the milestones: 0.4.4, 0.4.6, 0.4.5 Mar 2, 2018
@Scrum Scrum removed this from the 0.4.6 milestone Mar 16, 2018
@Scrum Scrum added this to the 0.4.7 milestone Mar 16, 2018
@Scrum Scrum modified the milestones: 0.4.7, 0.4.8 Sep 4, 2018
@Scrum Scrum modified the milestones: 0.4.8, 0.4.9 Oct 11, 2018
@Scrum Scrum modified the milestones: 0.4.9, 0.4.10 Apr 1, 2019
@Scrum Scrum modified the milestones: 0.4.10, 0.4.11, hold Jun 24, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants