I'm using Laravel and in my bootstrap.js file I have
window.ProgressBar = require('progressbar.js');
and then I require the bootstrap.js file into app.js
require('./bootstrap');
And I use webpack.mix.js to compile it
mix.js('resources/assets/js/app.js', 'public/js')
If I attempt to access progressbar.js inside of app.js it works perfectly.
However, If I attempt to use it outside of app.js in script tag that comes after app.js on my pages, ProgressBar is undefined.
How can I access ProgressBar outside of my app.js but keep it imported via app.js ?
Example on index.blade.php
<script src="app.js" defer></script>
<script>
const progress = new ProgressBar; //undefined...
</script>
constimplementations in the browser either.const? Are you saying I should useletorvarinstead?constandletare both es6, es6 features may not be implemented in all browsers.deferon the<script>tag and for some reason that stopped it from working. As forconstandlet- caniuse.com/#search=const caniuse.com/#search=let Based off of that, I'm happy to use it