`require('postcss-plugin')()` vs `require('postcss-plugin')` (without invocation)
还没有人认领这个 Issue。
评估
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 新手友好度
- 35/100
- Issue 类型
- 文档
- 描述清晰度
- 需要澄清
- 活跃度
- 停滞
- 技术栈
- javascript, tailwindcss
调研方向
Start by reading the plugin examples linked from postcss-load-config and autoprefixer, then compare them with the postcss.config.cjs and tailwind.config.cjs usage described here. Clarify the preferred invocation form and document the observable loading behavior so the examples agree.
由索引模型根据 Issue 内容生成。
描述
Hi @ai, thank you for your work on postcss and autoprefixer (and your other packages). We're using them in combination with Vite, Svelte, and Tailwind, and we'd appreciate a clarification on how to specify plugins in postcss.config.cjs.
In this repo (ref), you instruct to require and then invoke a plugin:
module.exports = ({ env }) => ({
plugins: [
env === 'production' ? require('postcss-plugin')() : false // <- with invocation
]
})
In autoprefixer (ref), you instruct to require a plugin without invoking it:
module.exports = {
plugins: [
require('autoprefixer') // <- without invocation
]
}
While investigating performance issues with VS Code, I added a console.log to tailwind.config.cjs and found that:
- With
require('tailwindcss'), Tailwind's config file is loaded several times - With
require('tailwindcss')(), Tailwind's config file is loaded only once
Question: Could you clarify what is the preferred way to specify plugins?
Thank you for your help!
- 主要语言
- JavaScript
- 星标
- 661
- 派生
- 76
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
postcss/postcss-load-config 的其他 Issue
-
难度 3/5 1-2 天 新手友好度 25/100
postcss/postcss-load-config#266 · 3 条评论 ·
-
难度 4/5 3-5 天 新手友好度 25/100
postcss/postcss-load-config#248 · 1 条评论 ·
-
难度 3/5 1-2 天 新手友好度 38/100
postcss/postcss-load-config#221 · 4 条评论 ·
-
难度 5/5 一周以上 新手友好度 25/100
postcss/postcss-load-config#212 · 7 条评论 ·
-
priority: medium semver: minor type: feature
难度 5/5 一周以上 新手友好度 25/100
postcss/postcss-load-config#183 · 1 条评论 · 4 个 reaction ·
查看 postcss/postcss-load-config 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 86/100
Forrest-Technologies/drover#1040 ·
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 85/100
维护者通常 1 天内回复
-
good first issue help wanted
难度 1/5 1 小时以内 新手友好度 90/100
erkamyaman/rust-anything#702 ·
维护者通常 1 天内回复
-
enhancement good first issue
难度 2/5 1-3 小时 新手友好度 85/100
-
good first issue help wanted
难度 2/5 1-3 小时 新手友好度 88/100
erkamyaman/unslop-anything#231 ·
维护者通常 1 天内回复