You should check which libraries your template is using, and which version for each library. then install them using npm. then in your app.js, and app.scss import the scripts and styles for the libraries.
Jun 24, 2020
5
Level 2
compile css and js
hey everybody, for my front end I download template adds I copy CSS and js code to my public folder. then I access it as {{asset()}}.
my question is what is the best way to better performance (page-load). and how to use can for my template css and js.
//instead of just copy my CSS and js and compressed, I prefer using laravel mix like this
mix.js('resources/js/app.js', 'public/js')
js('resources/js/jquery-3.3.1.min.js', 'public/js')
js('resources/js/jquery-ui.js')
js('resources/js/popper.min.js', 'public/js')
js('resources/js/aos.js', 'public/js')
.sass('resources/sass/app.scss', 'public/css')
.sass('resources/sass/bootstrap.min.css', 'public/css')
.sass('resources/sass/magnific-popup.css', 'public/css')
most of css and js code are static, so how can I use cdn for template driven css and js.
thanks in advance
Level 47
Yes, for each css or js file you are making a new request to the server, the server has to find the file and send a response. it is better if you bundle your assets in one file.
Please or to participate in this conversation.