@jonathan401
Posted
Nice work on this challenge ππ. Sorry again I had to ask, when I looked at your package.json
file, I noticed you used Babel and gulp. Could you point me to any resource that teaches how to use Babel and gulp. Because I want to make my next challenge backwards compatible too (i.e the JavaScript).
@karolbanat
Posted
@jonathan401 Hi againπ.
Sorry I can't point to a specific resource about Gulp and Babel. Actually I use the gulpfile.js
from the Web Dev course I took on Udemy/Teachable, and when I need to update this file, I just read the docs or search for gulp plugins. With Babel most of the time I just need this line: presets: ['@babel/preset-env']
. <- that line actually helps to compile js to older versions.
With the file I use, if I just include it in the project folder with package.json, I just run npm i
and then gulp
command. gulp
command just runs the function I exported as default in gulpfile.js
(exports.default = series(mainFunctions, startBrowserSync, watchForChanges)
). It compiles and minifies scss an js files, saves it in ./dist
folder and starts BrowserSync. Then, if I just write code and save it, it automatically refreshes the browsers.
I didn't find a fine resource on learning Gulp or Babel too, so, as I wrote on the other comment, here, too, I read the docs and experiment with different setups π§ͺ.
If you are using React then I think it's better to use Webpack. And I think that, for example, create-react-app has configured webpack with babel and other stuff behind the scenes.
Sorry I couldn't help you much again π.
@jonathan401
Posted
@karolbanat thanks you!. Really that was more than enough π