In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-09-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)05/31 Report--
This article mainly explains "how to optimize the home page loading speed in the vue project", the content of the article is simple and clear, easy to learn and understand, the following please follow the editor's ideas slowly in depth, together to study and learn "how to optimize the home page loading speed in the vue project" bar!
1: optimization for third-party js libraries
The main third-party js libraries used in our project are: vue, vue-router, vuex, axio, and we also use qiniu. We all know that the js files of these dependent libraries will be packaged together into the vender js file. If your third party depends on a lot of libraries, it will cause the vender file to be very large, and the loading speed of the first screen will definitely be slowed down.
Our solution to this problem is to use the cdn file of the document instead of packaging it into vender. The specific measures are as follows:
1: introduce the dependent library js file into index.html
/ / index.html
2: remove the import of the third-party js, because it has been referenced through the script tag in the first step.
3: remove the js file of the third-party library from the packaged file
The way to do this is to take advantage of webpack's externals. To do this, add externals at the same layer as rules in the module of the build/webpack.base.conf.js file:
Thank you for your reading, the above is the content of "how to optimize the home page loading speed in the vue project". After the study of this article, I believe you have a deeper understanding of how to optimize the home page loading speed in the vue project. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
The market share of Chrome browser on the desktop has exceeded 70%, and users are complaining about
The world's first 2nm mobile chip: Samsung Exynos 2600 is ready for mass production.According to a r
A US federal judge has ruled that Google can keep its Chrome browser, but it will be prohibited from
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
About us Contact us Product review car news thenatureplanet
More Form oMedia: AutoTimes. Bestcoffee. SL News. Jarebook. Coffee Hunters. Sundaily. Modezone. NNB. Coffee. Game News. FrontStreet. GGAMEN
© 2024 shulou.com SLNews company. All rights reserved.