What’s wrong with the packing?
- Test: to send version, make a package to me
- Me: All three projects?
- Test: 1.
Five minutes passed…
- Test: Ready
- Me: Just finished building and compressing
The next, the test is here
- Patted me on the shoulder and asked: why couldn’t it be compressed easily during build? Can you handle it? !
- I:…
So, 1202 years later, you’re still doing manual zip compression?
Use webPack FileManagerPlugin.
Automatic compression using the FileManagerPlugin plugin
1. Install the FileManagerPlugin dependency
Yarn add filemanager webpack - plugin @ ^ 5.0.0 - devCopy the code
2. vue.config.jsTo configure the use of
// Introduce the plug-in first
const FileManagerPlugin = require('filemanager-webpack-plugin')
module.exports = {
publicPath: '/vue3-web'.outputDir: 'dist'.assetsDir: 'static'.configureWebpack: {
plugins: [
new FileManagerPlugin({
/ / attention! Remember that you need to add a layer of Events nodes here, otherwise you will get an error
events: {
onEnd: {
delete: [
'./dist.zip',].archive: [{
source: './dist'.destination: './dist.zip'}]}})]}}Copy the code
3. Run the tests
Testing: Entering…
I: dist. Zip file has been sent successfully!