I have a problem with the libraries, I have a landing page that has its js and css and I have another template for users who have their own css and js except for one that they share between the two and the problem is that in landing it has the login and I do not use datatables then it pulls me error of datatables is not defined or vue is not defined and it does not finish loading the page if I do not import the js, something that if I use in the user template. Is there any way to fix this? I tried to do the next thing I saw on the internet but did not walk:
if (typeof DataTable !== 'undefined') {
$(".datatables").DataTable();
}