Why does React require Babel and Webpack to work?

前端 未结 2 1835
余生分开走
余生分开走 2021-02-01 17:49

I was looking at the wiki page of vue.js and saw this:

When compared to React development, Vue can be integrated to an existing web application much mor

2条回答
  •  野趣味
    野趣味 (楼主)
    2021-02-01 18:36

    No, Babel and Webpack is not necessary for React stack. You can still find other alternatives to build your favourite stack such as Browserify and Gulp.

    However, if you want to make things easier, I do recommend you learn and use Babel and Webpack together with React because:

    • You can use modules.
    • You can use JSX with ES6.
    • It support a lot of browsers
    • You can use more advanced features (async/await) etc

    With webpack

    • You can use different loaders for sass, less, postcss etc
    • You can use different plugins to optimise your build such as Uglify, HotModuleReplacement, Chunks etc

    There are many more advantages to use webpack which you can find here

提交回复
热议问题