删除前端无用package包

This commit is contained in:
不做码农 2021-11-14 21:35:18 +08:00
parent ff5a70589a
commit 3acddbbb65
3 changed files with 30 additions and 65 deletions

View File

@ -29,45 +29,19 @@ npm run build:stage
npm run build:prod
```
## nginx配置
# 插件说明
### Autoprefixer
浏览器自动补全前缀
例如:
```
a{
transition :transform 1s
}
``` shell
server {
#修改要监听的端口
listen 8080;
#修改要绑定的域名或IP地址
server_name localhost;
# charset koi8-r;
access_log logs/logs.access.log main;
# 后端接口 生产环境
location /prod-api/ {
proxy_pass http://localhost:8888/;
# 后端的Web服务器可以通过X-Forwarded-For获取用户真实IP
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
# 如果请求被负载均衡的服务器返回类似500这样的将继续请求下一台应用服务器默认 对post,lock,patch的请求不进行重试如果要设置在后面添加 non_idemponent
# proxy_next_upstream error timeout invalid_header http_500 http_502 http_503 http_504;
}
# vue项目配置
location / {
#将xxxxx路径改成你的发布路径
root html/zradmin_vue;
index index.html;
try_files $uri $uri/ /index.html;
}
error_page 404 /404.html;
# redirect server error pages to the static page /50x.html
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
将会补全如下
a{
-webkit-transition :-webkit-transform 1s;
transition :-ms-transform 1s;
transition :transform 1s
}
```

View File

@ -40,42 +40,33 @@
"quill": "1.3.7",
"screenfull": "4.2.0",
"sortablejs": "1.8.4",
"vue": "2.6.10",
"vue": "2.6.12",
"vue-count-to": "1.0.13",
"vue-cropper": "0.4.9",
"vue-router": "3.0.2",
"vue-router": "3.4.9",
"vuedraggable": "2.20.0",
"vuex": "3.1.0"
"vuex": "3.6.0"
},
"devDependencies": {
"@vue/cli-plugin-babel": "4.4.4",
"@vue/cli-plugin-eslint": "4.4.4",
"@vue/cli-plugin-unit-jest": "4.4.4",
"@vue/cli-service": "4.4.4",
"@vue/test-utils": "1.0.0-beta.29",
"autoprefixer": "9.5.1",
"babel-eslint": "10.1.0",
"babel-jest": "23.6.0",
"babel-plugin-dynamic-import-node": "2.3.3",
"chalk": "4.1.0",
"chokidar": "2.1.5",
"connect": "3.6.6",
"eslint": "6.7.2",
"eslint-plugin-vue": "6.2.2",
"filemanager-webpack-plugin": "^6.1.4",
"html-webpack-plugin": "^3.2.0",
"husky": "1.3.1",
"lint-staged": "8.1.5",
"node-sass": "4.14.1",
"plop": "2.3.0",
"runjs": "4.3.2",
"sass-loader": "8.0.2",
"script-ext-html-webpack-plugin": "2.1.3",
"script-loader": "0.7.2",
"serve-static": "1.13.2",
"svg-sprite-loader": "4.1.3",
"svgo": "1.2.0",
"vue-template-compiler": "2.6.10"
"svgo": "2.8.0",
"vue-template-compiler": "2.6.12"
},
"engines": {
"node": ">=8.9",

View File

@ -1,7 +1,7 @@
'use strict'
const path = require('path')
const defaultSettings = require('./src/settings.js')
const FileManagerPlugin = require('filemanager-webpack-plugin');
// const FileManagerPlugin = require('filemanager-webpack-plugin');
function resolve(dir) {
return path.join(__dirname, dir)
@ -53,17 +53,17 @@ module.exports = {
}
},
plugins: [
new FileManagerPlugin({
events: {
onEnd: {
//首先需要删除项目根目录下的dist.zip
delete: ["./dist/*.zip"],
// new FileManagerPlugin({
// events: {
// onEnd: {
// //首先需要删除项目根目录下的dist.zip
// delete: ["./dist/*.zip"],
//然后我们选择dist文件夹将之打包成dist.zip并放在根目录
archive: [{ source: "./dist", destination: "./dist/dist.zip" }]
}
}
})
// //然后我们选择dist文件夹将之打包成dist.zip并放在根目录
// archive: [{ source: "./dist", destination: "./dist/dist.zip" }]
// }
// }
// })
]
},
chainWebpack(config) {