पाठ 15 / 25

Frameworks के साथ काम करना

Webpack को popular frameworks के साथ integrate करें।

Framework-specific tooling

अधिकांश frameworks (React, Vue, Angular) scaffolding tools provide करते हैं जो Webpack को pre-configure करते हैं। Webpack को समझना आपको इन configurations को customize करने में मदद करता है।

React configuration को extend करें

Create-react-app Webpack config को customize करने के लिए CRACO use करें।

// craco.config.js
module.exports = {
  webpack: {
    configure: (config) => {
      config.optimization.minimize = false;
      return config;
    }
  }
};

Output:

Customize CRA Webpack configuration without ejecting

Ejecting अंतिम साधन है

Create-react-app से ejecting को avoid करें जब तक जरूरी न हो। Ejecting सभी config को expose करता है। पहले overrides या alternative tools try करें।

त्वरित जाँच

त्वरित जाँच: Framework CLIs का उपयोग करने का benefit क्या है?

  • Framework की जरूरतों के लिए pre-configured Webpack।
  • तेजी से runtime performance।
  • Guaranteed छोटे bundle sizes।
Answer

Framework की जरूरतों के लिए pre-configured Webpack। — Framework CLIs pre-configured Webpack setups provide करते हैं जो framework के लिए optimized हों।