Should you use Babel in every project?
-
Just wondering if babel is badly needed? And in general, is it necessary to convert js to es5?JavaScript Anonymous, Nov 17, 2019
-
What browsers are you planning to support on your project? Answer this question, I think you will answer your own.Clare Sanchez
-
I do this on my projects:
in the root I put my default .gulpfile
require('@babel/register');
require('require-dir')('./gulp/tasks', { recurse: true });
I create a folder / gulp / tasks into which I copy the necessary tasks from my archive of developments, 80% of them are the same everywhere, therefore the package.json and the contents of the tasks folder are almost the same. For paths, and other variables that differ, I create a separate unique .json file, in which there are already variables that only need to be filled.
As a result, the complete setup of the collector, together with the babel and all the cool tricks, takes me about 10-15 minutes per project. This time pays off in a couple of hours of work due to LiveReload, auto-deploy, the habit of working with your stack, etc.
Therefore, I would advise you to thoroughly prepare your collector once and add it to all your projects. Of course - it's worth it, you will understand it yourself later.Matthew Harvey
2 Answers
Your Answer
To place the code, please use CodePen or similar tool. Thanks you!