Due to security reasons I move all directories and files into a main directory and took out all files/directories from public folder to root of Laravel project. Now I want to npm run dev in order to compile scss files to css and js to js. However each time I run npm run dev it creates a folder named public inside the main folder I had created and put compiled files into that. But I want to put it in root folder which contains: css-js-svg-fonts-index so I changed
This:
mix.js('resources/js/app.js', 'public/js')
.sass('resources/sass/app.scss', 'public/css');
to this:
mix.js('resources/js/app.js', '../../js')
.sass('resources/sass/app.scss', '../../css');
but no result :( it just creates public folder inside main folder that is not the root I want it to be one level upper.
Thanks
I found it :)
mix.setPublicPath('../')
.js('resources/js/app.js', 'js')
.sass('resources/sass/app.scss', 'css');
but previously I was wrong with an extra slash which was:
mix.setPublicPath('../')
.js('resources/js/app.js', '/js')
.sass('resources/sass/app.scss', '/css');
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With