FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

docs: show ESM and TypeScript plugin declaration by Hashim1999164 · Pull Request #2118 · postcss/postcss · GitHub

docs: show ESM and TypeScript plugin declaration - #2118

Merged
ai merged 2 commits into
postcss:mainfrom
Hashim1999164:docs/esm-typescript-plugin-declaration
Jul 29, 2026
Merged

docs: show ESM and TypeScript plugin declaration#2118
ai merged 2 commits into
postcss:mainfrom
Hashim1999164:docs/esm-typescript-plugin-declaration

Conversation

Hashim1999164 commented Jul 22, 2026
edited
Loading

Copy link
Copy Markdown
Contributor

Summary

Test plan

  • Confirm the ESM example matches the PluginCreator / postcss = true API in lib/processor.js
  • Skim docs site rendering for the new snippets in Writing a Plugin and Plugin Guidelines

Document the maintainer-recommended pattern of setting postcss = true on
the creator function and default-exporting it, so ES modules and TypeScript
do not need module.exports.

Fixes postcss#1771

ai commented Jul 22, 2026

Copy link
Copy Markdown
Member

Thanks!

Can I ask you to replace CommonJS in examples to ESM. Let’s not keep ESM as an option since it is a new default in JS.

Copy link
Copy Markdown
Contributor Author

Updated the examples so ESM is the default rather than an additional option: the JavaScript examples now default-export the plugin creator, while the TypeScript example remains for typing guidance.

ai merged commit fbad419 into postcss:main Jul 29, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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.

Document how to declare a PostCSS plugin in an ES6/TypeScript module

2 participants


Back | FazBrowse Home | New Git URL