The previous two days is online, and
Vue-CLI NPM Run Build command is packaged. After packaging is completed, I wiped a hop, 15m. I was not intended to be optimized, but every time I look at the deployment package so big, think about it, I will optimize it, let the bag look good, so that the psychological shadow will be left!
After drying the MAP file, discover the speed of the WebPack this package, it is also touching. When doing automatically generates the MAP file settings, there is a
ProductionGzip feature that webpack comes with
, and the sure is a one-time drum.
The following is the juggling process, and it is almost drumping.
config / index.js
After the value is modified, NPM Run Build can be performed at this time. However, it will report an error, prompting “Cannot Find Module ‘Compression-WebPack-Plugin'” [“
2, that is, the installation of compression-webpack-plugin official recommendation The command is: (but the net is not good, cool)
NPM install --save-dev compression-webPack-plugin // No given version number When the command is installed by default, the latest version-WebPack-Plugin is installed. The problem is just hereafter the installation is complete, re-run npm run build
From an error display, it is known that the configuration option is failed, but which verification failed, or those item validation failed. , Open the error log, the more you look, the more you are, and a face is awkward. I didn't see it from the source code.
From the check parameters, the parameters are two, but the first parameter has a lot of attributes.
From the results, the verification of this line code is failed. As for what this line code is executed, the level is not enough to check.
The last didn’t get a law, only go to the official website https://www.npmjs.com/package/compression-webpack-plugin to see, there is a breakthrough. When you go in the first eye, I have aimed 2.0.0 • Public • Publish3 Months Ago, I feel a bit wrong, the general small version of the update is 1.xx.xx, very few such direct full, all zero Suitable for the upgrade update of the large version, then look at the configured item test, the option property does not match the option attribute. Suddenly there is a feeling of inexplicably. Then look at the introduction and document below, 1 first correspond to the Node version email@example.com, still within the range. 2 Requirements: this Module Requires a Minimum of Node V6.9.0 and WebPack V4.0.0 (This module requires Nodev6.9.0 and WebPack V4.0.0), and I have a significant difference in WebPack version. This finally found the crux.
3, find the crux, it is simple. Since the latest version is too high, I can’t downgrade it with the Webpack high climbing.1 unloadingThe latest version of the installed 2.0
NPM Uninstall –Save-Dev Compression-WebPack-Plugin
2 Reinstall 1.1.12 version ( This version is the latest version of 1.1). Uninstalling can not be used, directly execute the installation command, and the version coverage is also possible.
npm install –save-dev firstname.lastname@example.org // Remember to bring version number
, finally succeeded, really fucking!
During the installation process, there is another problem. Net speed and wall problem:
The above is the Solid-CLI Webpack package to open the Gzip error problem, I hope that everyone has helpful. If you have any questions, please leave a message, the small package will reply to everyone in time. Thank you very much for your support of Tumi Cloud Website!If you think this article helps you, welcome to reprint, please indicate the source, thank you!