`require('postcss-plugin')()` vs `require('postcss-plugin')` (without invocation)
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 35/100
- Loại issue
- Tài liệu
- Độ rõ ràng
- Cần làm rõ
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- javascript, tailwindcss
- Lĩnh vực
- documentation
Hướng nghiên cứu
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.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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!
- Ngôn ngữ chính
- JavaScript
- Star
- 661
- Fork
- 76
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của postcss/postcss-load-config
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 25/100
postcss/postcss-load-config#266 · 3 bình luận ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 25/100
postcss/postcss-load-config#248 · 1 bình luận ·
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 38/100
postcss/postcss-load-config#221 · 4 bình luận ·
-
How to use async function?Đang mở
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
postcss/postcss-load-config#212 · 7 bình luận ·
-
Load config from NPM packageĐang mởpriority: medium semver: minor type: feature
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
postcss/postcss-load-config#183 · 1 bình luận · 4 reaction ·
Tất cả issue của postcss/postcss-load-config
Issue tương tự
-
fix: the live capture mode of check-native-browser.mjs ignores PLAYWRIGHT_CHROMIUM_EXECUTABLEĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 86/100
Forrest-Technologies/drover#1040 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 85/100
Maintainer thường phản hồi trong vòng 1 ngày
-
good first issue help wanted
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 90/100
erkamyaman/rust-anything#702 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement good first issue
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
-
good first issue help wanted
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
erkamyaman/unslop-anything#231 ·
Maintainer thường phản hồi trong vòng 1 ngày