Using Babel, I successfully transpiled ES6 JavaScript to ES5 for the project found at
I'm currently stuck on updating my .babelrc
file in order to automatically transpile a specific ES6 file to a particular ES5 file.
Can someone guide me on what code needs to be added into my .babelrc
file to achieve this? Is it feasible?
This is the current content of my .babelrc
file:
{
"presets": [
"@babel/preset-env",
"minify"
]
}
The command I execute on iTerm in Mac to perform the transpilation from an ES6 file to an ES5 file is:
npx babel ./assets/js/scripts.js --out-file ./assets/js/scripts.min.js
These are the npm modules that have been installed locally within the project directory:
├── @babel/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="ed8e8184ddde00848d83dab8808395868b84a1808680">[email protected]</a>
├── @babel/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="afccc0d977802436361046aa80cf1cc71c3332363e372c3972cfc387ebc7cdc6cbcacfcbfe8581898c819ee585898b89">[email protected]</a>
├── @babel/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="56262433478e43474344434506">[email protected]</a>
├── <a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="b8dad9dacadfd913dbdaeab7d9"><strong>[email protected]</strong></a>
└── <a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="8deee2ffe88b463f373e25326e212d25">[email protected]</a>