How to import JavaScript Sheet to be Evaluated as text/babel


I have been going through the Kirupa React videos which have been very good. I would like to put my JavaScript into a JavaScript file and import that file like this <script type="text/babel" src="main.js"></script>, but it is not importing the file at all.

Could I please get some help?


This setup isn’t designed for external files. The recommended approach is to use a bundler like webpack. This walks you through an easy way of getting all that up and running:


OK, that makes sense, thank you!