Home > OS >  Should i use webpack or create-react-app?
Should i use webpack or create-react-app?

Time:07-01

Should i use webpack or create-react-app to initialize my react app? Is there any advantage of using webpack over create-react-app?

CodePudding user response:

Create react app abstracts the configuration does not allow you change it unless you eject. Using webpack does require knowledge of webpack and does allow complete control over your environment.

CRA is best suited for projects where you the requirements does not need you to change settings , if you need control and need to change things it is best to use Webpack.

CodePudding user response:

First, Webpack is a build tool, which uses configuration to (as an example) transpile Typescript to JavaScript, bundle SASS, LESS files, bundle SVG files etc.

Create React App is a React boilerplate that uses Babel and Webpack under the hood, with configurations already in place for the most common scenarios, so you don't have to worry about it.

It is not clear from your question, what initialization means. I can only assume that you mean to bootstrap an application with a moderately easy learning curve. If that is the case, CRA is the way to go.

  • Related