What is this?
This post is personal reference
TL:DR
The other day I started building an APi first project with Node and express and I have become so accustom out of the box support for ES6 for the last few years using
, or hoping into a that whenimport express from 'express'
exploded I was a little taken aback...:blush:
Naturally I Googled "Nodejs Babel Config" and the one I liked was
. Being particularly lazy and also aware that I have configured a node project for ES6 a thousand times. I quickly scrolled to the few command I needed which are listed below.The Commands and Files
npm i --save-dev nodemon @babel/core @babel/node @babel/preset-env
.babelrc
{"presets": ["@babel/preset-env"]}
package.json
..."scripts: {..."dev": "nodemon --exec babel-node app.js"...}....
Notes:
In this particular project I ended up using webpack for my build due to the way
handles deployment.