So I'm working on a project that has quite a bit of Javascript. We're wanting to put the Javascript through Laravel Mix for it to be able to minify it as well as use NPM modules in it. We've moved the files over into the resources directory, and added them into the webpack.mix.js. But after running npm run dev I can no longer access the functions that were in those Javascript files in the HTML, developer console, or from other JS files.
Here's what my webpack file looks like currently.
mix.babel('resources/js/app.js', 'public/js/app.js')
.babel('resources/js/mobile/global.js', 'public/js/mobile/global.js')
.babel('resources/js/lw-sortable.js', 'public/js/lw-sortable.js');
mix.sass('resources/sass/app.scss', 'public/css/app.css')
.sass('resources/sass/darkmode.scss', 'public/css/darkmode.css')
.sass('resources/sass/dashboard.scss', 'public/css/dashboard.css');
I would just use mix.scripts() for the minification, but I would also like to be able to use the import statements with NPM modules directly into the JS.
Any help would be greatly appreciated. Thanks!