Procees Followed;
- Went to babel website, because i know that to parse the jsx to js. I needed babel somehow.
- The default suggestion is adding babel.config.json file having babel preset
@babel/env
which is same as@babel/babel-reset-env
due to how these guys put up things in babel.
You can create preset using these kind of function :
module.exports = () => ({
presets: [
require("@babel/preset-env"),
],
plugins: [
[require("@babel/plugin-proposal-class-properties"), { loose: true }],
require("@babel/plugin-proposal-object-rest-spread"),
],
});
The these preset can contain another preset and also another plugin.
These plugins run from last to first.
But what plugins do ? Plugin are the way to modify the code in desired format using babel APIS, more on this later. babel gives you lot of utility to analyze the code and transform into someother formats.
Babel preset are the meat of logic where transformations happen. babel has alrady readymade preset made for common conversions
like @preset/react, @preset/typescript
WHat they do ? Go inside them and undesrtand it. SOmetime later i will see them on case to case basis.
// https://webpack.js.org/api/node/
// https://github.com/nodejs/node-eps/blob/master/002-es-modules.md#451-environment-variables