Laravel 5 mix app.js file creation
问题 I created a custom JavaScript file with a simple function: function picture(soemthing){ document.getElementById('idXYZ').src = "example.com"; } Then I added this file to the webpack.mix.js config: mix.js(['resources/assets/js/app.js', 'resources/assets/js/xyz.js'], 'public/js') .sass('resources/assets/sass/app.scss', 'public/css'); and run: npm run dev. npm compiled my script and the picture function was included in the app.js file. Now I'd like to use the "picture" function in a blade.php