Level 6
hi , to add functions.js file to public/js folder , you just need to mention folder within public directory. Which in this case is js, so simply write :
mix.js('resources/js/function.js', 'js')
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Hello there. I have
mix.js('resources/js/functions.js', 'public/js')
in my webpack file. Then in resources/js/functions.js I will have my javascript code. Weirdly enough, it is then put inside an anonymous function inside public/js which makes me not able to use it. It looks like this.
Please or to participate in this conversation.