I'm building an app with the AirConsole JS service. AirConsole only provides their library as a .js file you would include in your page with the usual:
<script type="text/javascript" src="https://www.airconsole.com/api/airconsole-1.6.0.js"></script>
However, I'm using Webpack and would like to import the script into my other JS files. I have tried a few methods with no luck:
- Create an entry file named
vendorwhich imports theairconsole.jsfile. This creates avendor.bundle.jsfile which I can include on my page - Add the AirConsole path to my
indexentry point so the script is included in thebundle.jsfile. With this method I can verify the AirConsole code is included in thebundle.jsfile but attempting to create a new instance ofAirConsoleresults inAirConsoleis undefined
Am I on the right track with these methods? If not, what is the recommended way to import a non-module .js file?