![]() ![]() In the scripts section, remove the test script, and add two new scripts: a script named babel that compiles main.js to a version of ECMAScript that can run in current browsers, and a script named start that starts the local web server. Babel is a toolchain that is mainly used to convert ECMAScript 2015+ code into a backwards compatible version of JavaScript in current and older browsers or environments. Open package.json in your favorite code editor. ![]() I highly recommend using this syntax highlighting with a theme. ![]() npm install babel/cli babel/core babel/plugin-proposal-pipeline-operator To direct babel about the compilation of the code properly, a file named. JavaScript syntax highlighting for ES201x, React JSX, Flow and GraphQL. We are using a local web server because some parts of this tutorial require the application to be loaded using the http protocol and will not work if loaded using the file protocol. A pipeline operator is not currently part of JavaScript language, babel is used to compile the code so that it can be understood by Node. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |