To run ES6 we need to transpiling. That includes:
type="text/babel"
To automatize this process we use WebPack
Install, and initialize NPM
$ npm init
Install Webpack for auto transpiling (for any installation problem, install globally)
$sudo npm install -g webpack
check the config file
if this appears: “configuration.module has an unknown property ‘loaders'”
change “loaders” to “rules”
if “babel-loader@8 requires Babel 7.x” occurs… install :
$npm install -D babel-loader @babel/core @babel/preset-env webpack
IF… “Did you mean “@babel/env”?”
$npm install babel-preset-env
If there is any more errors and webpack cant run…
$./node_modules/.bin/webpack
NOTE: This post is a personal backup for me. Learned from https://www.linkedin.com/learning/learning-ecmascript-6/welcome