How can I stop loading unnecessary script files before page loads in Vue.js?

67 views Asked by At

I'm currently writing a Vue.js app inside a low-code platform. The platform contains unnecessary libraries like bootstrap. When I checked my app for performance, I noticed that because the platform contains bootstrap under the hood, bootstrap files are getting loaded alongside my project. I am looking for a solution that helps to remove unnecessary scripts files that are connected to html. I don't just want to remove them, but I really want to stop them from loading because I don't need those scripts to be running in my project

I tried to use some of the lifecycle hooks of Vue.js like mounted, beforeMount, setup and then I selected script tags that aren't necessary and I set their src attribute to empty string. But that didn't help me to prevent them from loading. The unnecessary scripts are really slowing my website down

1

There are 1 answers

0
Eduardo On

Given you're trying to use Vue inside of another application and your Vue code doesn't trigger that request for the Bootstrap library, you can't prevent it, unfortunately.