Configuring babel
Babel is a very popular tool that compiles JavaScript code so that we can use new features in older and current browsers (such as JSX or arrow functions). It is recommended to use babel in any serious JavaScript project.
By default, the webpack-simple template comes with a default babel configuration, which uses the env babel preset that supports all the stable JavaScript version from ES2015. It also includes another babel preset called stage-3, which supports the upcoming JavaScript features such as the async/await keywords and the object spread operator that are commonly used in the Vue community.
We will need to add a third preset specific to Vue, which will add support for JSX (we will need it in the 'JSX' section later ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access