पाठ 23 / 31

SWC Plugins और Ecosystem

SWC की built-in सुविधाएँ और बढ़ता plugin ecosystem देखें, और plugin न मिलने पर उसे Babel के साथ मिलाएँ।

SWC plugins: Babel से कम

SWC के पास Babel से कम plugins हैं क्योंकि यह common features को natively cover करता है। लेकिन ecosystem बढ़ रहा है। Standard transpilation के लिए, SWC box के out से काम करता है।

Built-in बनाम plugin features

SWC में TypeScript, JSX, async/await, destructuring, और अधिकांश आधुनिक features natively शामिल हैं। Plugins edge cases को extend करते हैं या experimental features को जोड़ते हैं।

लापता features के लिए Babel को fallback करें

यदि आपको एक Babel plugin चाहिए जो SWC support नहीं करता है, तो पहले SWC को चलाएँ, फिर उस specific plugin के लिए Babel के through pipe करें। Rare, लेकिन कभी-कभी आवश्यक।