Skip to content

docs(README): fix the gulp example - #279

Merged
ai merged 1 commit into
postcss:mainfrom
wahidrizka:docs-gulp-example
Sep 30, 2026
Merged

ai merged 1 commit into
postcss:mainfrom
wahidrizka:docs-gulp-example

Conversation

@wahidrizka

Copy link
Copy Markdown
Contributor

The gulp example in the README could not run:

  • It requires gulp-postcssrc, which is not on npm (the registry answers 404; Default option #18 calls it a proof of concept that "will stay unpublished"), so it fails with Cannot find module 'gulp-postcssrc'.
  • The }) after the css function is left over from 0f26c60, when task('css', () => { ... }) became const css = () => { ... }, so Node stops with SyntaxError: Unexpected token ')'.
  • css does not return the stream, so gulp reports The following tasks did not complete: default, css and Did you forget to signal async completion?, and watch never starts.

It now uses gulp-postcss, which loads postcss.config.js through postcss-load-config when it gets no plugins, and returns the stream.

I ran the fixed example with gulp 5.0.1, gulp-postcss 10.0.0 and the README's postcss.config.js, on a file with @import and nesting. With NODE_ENV=production it writes .imported{color:blue}.card{color:red}.card .title{margin:0}, with NODE_ENV=development the same CSS without cssnano, then watch starts and rebuilds after a change. The example from main fails with the SyntaxError above, and the fixed one fails as described without return or with gulp-postcssrc.

The example required gulp-postcssrc, which is not on npm, had a
leftover ")" that made it a syntax error, and did not return the
stream, so gulp stopped with "Did you forget to signal async
completion?". Use gulp-postcss, which loads postcss.config.js
through postcss-load-config, and return the stream.
@ai
ai merged commit 4ab6921 into postcss:main Sep 30, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants