Set up compilation of source code using babel with npm scripts

Trevor Miller
InstructorTrevor Miller

Share this video with your friends

Send Tweet

We can write our package using the latest JavaScript syntax with a compilation step. In this lesson we will install babel-cli and babel-preset-latest and wire up a build script to compile our code using the babel “latest” preset when source files change. This means those using our package can use it in any version of JavaScript even though we are using the latest syntax for our source code.

peterschussheim
peterschussheim
~ 4 years ago

FYI preset-latest has been deprecated, use env instead.