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

Hello,

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?

Thanks,
Adam

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: https://www.kirupa.com/react/setting_up_react_environment.htm

:slight_smile:

OK, that makes sense, thank you!