GitBucket
4.6.0
Toggle navigation
Sign in
Files
Branches
1
Tags
Issues
Pull Requests
Labels
Milestones
Wiki
08335
/
hivui-platform-template
hivui平台项目模板
Browse code
add
master
1 parent
2056a90
commit
cde0b46b8058f79a267b08f9e521916649c47d2d
caibinghong
authored
on 24 Jun 2021
Showing
6 changed files
Untitled-2.json
doc.txt
index.html
package.json
processes.json
可编译版package.json
Show notes
View
Untitled-2.json
100644 → 0
{ "name": "hi-vui-template", "version": "1.0.1", "description": "A hi-vui-template project", "author": "caibinghong <caibinghong@163.com>", "scripts": { "dev": "vite", "vite-build": "vite build", "vite-serve": "vite preview", "start": "npm run dev", "build": "node build/build.js", "build-list": "node build/build.js ./project/hivuiLogin", "build-watch": "node build/build-watch.js", "build-dev": "cross-env BABEL_ENV=dev" }, "dependencies": { "axios": "^0.21.1", "babel-polyfill": "^6.26.0", "classnames": "^2.3.1", "core-js": "^3.14.0", "enquire.js": "^2.1.6", "hi-ui": "^1.1.314", "lodash": "^4.17.21", "md5": "^2.3.0", "screenfull": "^5.1.0", "sortablejs": "^1.13.0", "vue": "^2.6.12", "vue-draggable-resizable": "^2.3.0", "vue-gemini-scrollbar": "^2.0.1", "vue-jstree": "^2.1.6", "vue-router": "^3.0.1", "vuex": "^3.6.2" }, "devDependencies": { "@vitejs/plugin-vue": "^1.2.3", "@vitejs/plugin-vue-jsx": "^1.1.5", "@vue/babel-plugin-jsx": "^1.0.6", "@vue/compiler-sfc": "^3.1.1", "autoprefixer": "7.2.3", "babel-core": "6.26.0", "babel-eslint": "8.0.3", "babel-helper-vue-jsx-merge-props": "2.0.3", "babel-loader": "7.1.2", "babel-plugin-component": "^1.1.1", "babel-plugin-syntax-jsx": "6.18.0", "babel-plugin-transform-runtime": "6.23.0", "babel-plugin-transform-vue-jsx": "3.5.0", "babel-preset-env": "1.6.1", "babel-preset-es2015": "^6.24.1", "babel-preset-stage-2": "6.24.1", "babel-preset-stage-3": "^6.24.1", "chalk": "2.3.0", "copy-webpack-plugin": "4.3.0", "cross-env": "5.1.1", "css-loader": "0.28.7", "eslint": "4.13.1", "eslint-friendly-formatter": "3.0.0", "eslint-loader": "1.9.0", "eslint-plugin-html": "4.0.1", "extract-text-webpack-plugin": "3.0.2", "file-loader": "1.1.5", "friendly-errors-webpack-plugin": "1.6.1", "html-webpack-plugin": "2.30.1", "less": "4.1.1", "less-loader": "3.0.0", "node-notifier": "5.1.2", "node-sass": "^4.7.2", "optimize-css-assets-webpack-plugin": "3.2.0", "ora": "1.3.0", "portfinder": "1.0.13", "postcss-import": "11.0.0", "postcss-loader": "2.0.9", "postcss-url": "7.3.0", "pushstate-server": "3.0.1", "rimraf": "2.6.2", "sass-loader": "6.0.6", "script-loader": "0.7.2", "semver": "5.4.1", "shelljs": "0.7.8", "svg-sprite-loader": "3.5.2", "uglifyjs-webpack-plugin": "1.1.3", "url-loader": "0.6.2", "vite": "^2.3.7", "vite-plugin-html": "^2.0.7", "vite-plugin-pagedata": "^1.0.3", "vite-plugin-vue2": "^1.6.2", "vue-loader": "13.5.0", "vue-style-loader": "3.0.3", "vue-template-compiler": "^2.6.14", "webpack": "3.10.0", "webpack-bundle-analyzer": "2.9.1", "webpack-dev-server": "2.9.7", "webpack-merge": "4.1.1" }, "engines": { "node": ">= 6.0.0", "npm": ">= 3.0.0" }, "browserslist": [ "> 1%", "last 2 versions", "not ie <= 8" ] }
Ignore Space
Show notes
View
doc.txt
node webpack 多config 编译执行 https://cloud.tencent.com/developer/section/1477277 parallel-webpack 多config 并行执行编译,这样提高速度 项目文件:/filesdisk2/eap5/web/workspace/eaptpl/deploy /filesdisk2/eap5/studio/workspace/eaptpl/deploy/eaptpl/01521/mokuai/shitu/004/dtv/1.0.0 deploy最终的项目部署目录 http://192.168.4.194:3000/eaptpl/01521/mokuai/shitu/abc/dtv/1.0.0/index.html 让npm run dev在Linux后台 持久运行 nohup npm run dev >/dev/null 2>&1 & exit 杀端口进程 netstat -apn|grep 3000 kill -9 18164 下面几个版本组合(有些版本没有列出来)。 npm install -g node-gyp https://github.com/webpack-contrib/sass-loader/blob/v6.0.7/package.json node-sass 对环境的要求 Node 12 的话要 node-sass 4.12+ 然页sass-loader 版本8的, 配对 node-sass版本4 npm i sass-loader@8.0.2 node-sass@4.13.0 -D npm rebuild node-sass npm i less@4.1.1 less-loader@3.0.0 -D npm cache clean -f rimraf node_modules npm shrinkwrap // npm-shrinkwrap.json 锁定包版本环境 1:npm install webpack -g 2: npm install webpack-cli -g 3: npm init -y 4: npm install webpack --save-dev 5: npm install html-webpack-plugin (html编译插件) 6:npm install clean-webpack-plugin 6.1: npm install webpack-dev-server (服务插件) 6.2: npm install style-loader css-loader (css打包插件) 6.3: npm install file-loader url-loader (文件图片打包插件) 6.4: npm install less-loader (less打包插件) 6.5: npm install sass scss --save-dev (sass scss打包插件) 6.6: npm install sass-loader nade-sass (sass打包插件) 7新建一个src文件夹 和 less文件夹 和webpack.config.js //以element 方式打包各各组件,做为按需导出使用 ElementUI/babel-plugin-component .babelrc "plugins": ["transform-vue-jsx", "transform-runtime", [ "component", { "libraryName": "hi-ui", "style":false } ]], Bundle or Bundleless?一起来看看前端构建问题 https://jishuin.proginn.com/p/763bfbd3be6b Snowpack 、 Vite 是尤大的力作https://cn.vitejs.dev/ 我将一个 Vue工程迁移到了 Vite 构建器下 https://www.bilibili.com/video/av796282782 vue2 使用 vite 所需求的步骤: 1、相关包安装 npm i '@vitejs/plugin-vue' '@vue/compiler-sfc' vite vite-plugin-vue2 -D 2、添加vite.confing.js import { createVuePlugin } from "vite-plugin-vue2"; 在配置项中,转vue plugins: [createVuePlugin()], 3、修改vite/dist/client/client.js case 'error': //判断当前出错的页面 let locPath = location.pathname.split('/'); locPath.pop(); if(err.id.indexOf(locPath.join('/'))==-1)break; 报类似这样的错误: Current process list running is not in sync with saved list. App BookStack differs. Type ‘pm2 save’ to synchronize. 按先后顺序,执行如下操作: pm2 update pm2 save pm2 list
node webpack 多config 编译执行 https://cloud.tencent.com/developer/section/1477277 parallel-webpack 多config 并行执行编译,这样提高速度 项目文件:/filesdisk2/eap5/web/workspace/eaptpl/deploy /filesdisk2/eap5/studio/workspace/eaptpl/deploy/eaptpl/01521/mokuai/shitu/004/dtv/1.0.0 deploy最终的项目部署目录 http://192.168.4.194:3000/eaptpl/01521/mokuai/shitu/abc/dtv/1.0.0/index.html 让npm run dev在Linux后台 持久运行 nohup npm run dev >/dev/null 2>&1 & exit 杀端口进程 netstat -apn|grep 3000 kill -9 18164 下面几个版本组合(有些版本没有列出来)。 npm install -g node-gyp https://github.com/webpack-contrib/sass-loader/blob/v6.0.7/package.json node-sass 对环境的要求 Node 12 的话要 node-sass 4.12+ 然页sass-loader 版本8的, 配对 node-sass版本4 npm i sass-loader@8.0.2 node-sass@4.13.0 -D npm rebuild node-sass npm i less@4.1.1 less-loader@3.0.0 -D npm cache clean -f rimraf node_modules npm shrinkwrap // npm-shrinkwrap.json 锁定包版本环境 1:npm install webpack -g 2: npm install webpack-cli -g 3: npm init -y 4: npm install webpack --save-dev 5: npm install html-webpack-plugin (html编译插件) 6:npm install clean-webpack-plugin 6.1: npm install webpack-dev-server (服务插件) 6.2: npm install style-loader css-loader (css打包插件) 6.3: npm install file-loader url-loader (文件图片打包插件) 6.4: npm install less-loader (less打包插件) 6.5: npm install sass scss --save-dev (sass scss打包插件) 6.6: npm install sass-loader nade-sass (sass打包插件) 7新建一个src文件夹 和 less文件夹 和webpack.config.js //以element 方式打包各各组件,做为按需导出使用 ElementUI/babel-plugin-component .babelrc "plugins": ["transform-vue-jsx", "transform-runtime", [ "component", { "libraryName": "hi-ui", "style":false } ]], Bundle or Bundleless?一起来看看前端构建问题 https://jishuin.proginn.com/p/763bfbd3be6b Snowpack 、 Vite 是尤大的力作https://cn.vitejs.dev/ 我将一个 Vue工程迁移到了 Vite 构建器下 https://www.bilibili.com/video/av796282782 vue2 使用 vite 所需求的步骤: 1、相关包安装 npm i '@vitejs/plugin-vue' '@vue/compiler-sfc' vite vite-plugin-vue2 -D 2、添加vite.confing.js import { createVuePlugin } from "vite-plugin-vue2"; 在配置项中,转vue plugins: [createVuePlugin()], 3、修改vite/dist/client/client.js case 'error': //判断当前出错的页面 let locPath = location.pathname.split('/'); locPath.pop(); if(err.id.indexOf(locPath.join('/'))==-1)break;
Ignore Space
Show notes
View
index.html
0 → 100644
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width,initial-scale=1.0"> <title>EAP5</title> </head> <body> <div id="app"></div> <% if(htmlWebpackPlugin.vite==true){%> <script type="module" src="./index.js"></script> <%}%> <!-- built files will be auto injected --> </body> </html>
Ignore Space
Show notes
View
package.json
{ "name": "hi-vui-template", "version": "1.0.2", "description": "A hi-vui-template project", "author": "caibinghong <caibinghong@163.com>", "scripts": { "pm2:start": "npm run rm:vite && pm2 start processes.json", "pm2:restart": "npm run rm:vite && pm2 restart all", "pm2:stop": "pm2 stop all", "pm2:log": "pm2 logs ", "pm2:cpu": "pm2 monit ", "pm2:kill": "pm2 delete all", "dev": "vite --host", "vite-build": "vite build", "vite-serve": "vite preview", "rm:vite":"rimraf node_modules/.vite", "start": "npm run dev", "build": "node build/build.js", "run": "node build/run.js", "build:login": "node build/build.js ./project/hivuiLogin", "build:main": "node build/build.js ./project/hivuiMain" }, "dependencies": { "@babel/runtime-corejs3": "^7.14.6", "@vue/babel-helper-vue-jsx-merge-props": "^1.2.1", "axios": "^0.21.1", "classnames": "^2.3.1", "enquire.js": "^2.1.6", "hi-ui": "^1.1.319", "lodash": "^4.17.21", "md5": "^2.3.0", "qs": "^6.10.1", "screenfull": "^5.1.0", "sortablejs": "^1.13.0", "vue": "^2.6.12", "vue-draggable-resizable": "^2.3.0", "vue-gemini-scrollbar": "^2.0.1", "vue-jstree": "^2.1.6", "vue-router": "^3.5.1", "vuex": "^3.6.2" }, "devDependencies": { "@babel/core": "^7.14.5", "@babel/plugin-transform-runtime": "^7.14.5", "@babel/preset-env": "^7.14.5", "@vitejs/plugin-vue-jsx": "^1.1.5", "@vue/babel-plugin-transform-vue-jsx": "^1.2.1", "@vue/babel-preset-jsx": "^1.2.4", "babel-loader": "^8.2.2", "babel-plugin-component": "^1.1.1", "babel-plugin-syntax-jsx": "^6.18.0", "babel-plugin-transform-vite-meta-env": "^1.0.3", "css-loader": "^0.28.7", "dotenv": "^10.0.0", "extract-text-webpack-plugin": "^3.0.2", "file-loader": "^1.1.5", "html-webpack-plugin": "^3.2.0", "less": "^2.7.3", "less-loader": "^3.0.0", "optimize-css-assets-webpack-plugin": "^3.2.0", "parallel-webpack": "^2.6.0", "postcss-import": "^11.0.0", "postcss-loader": "^2.0.9", "postcss-url": "^7.3.0", "semver": "^5.4.1", "shelljs": "^0.7.8", "svg-sprite-loader": "^3.5.2", "uglifyjs-webpack-plugin": "^1.1.3", "url-loader": "^0.6.2", "vite": "^2.2.4", "vite-plugin-html": "^2.0.7", "vite-plugin-pagedata": "^1.0.3", "vite-plugin-vue2": "^1.6.2", "vue-loader": "^13.5.0", "vue-style-loader": "^3.0.3", "vue-template-compiler": "^2.6.12", "webpack": "^3.12.0", "webpack-bundle-analyzer": "^4.4.2", "webpack-merge": "^4.1.1" }, "engines": { "node": ">= 6.0.0", "npm": ">= 3.0.0" } }
{ "name": "hi-vui-template", "version": "1.0.2", "description": "A hi-vui-template project", "author": "caibinghong <caibinghong@163.com>", "scripts": { "dev": "vite --host", "vite-build": "vite build", "vite-serve": "vite preview", "start": "npm run dev", "run": "node build/run.js", "build": "node build/build.js", "build-list": "node build/build.js ./project/hivuiLogin", "build-list1": "node build/build.js ./project/hivuiMain" }, "dependencies": { "@babel/runtime-corejs3": "^7.14.6", "@vue/babel-helper-vue-jsx-merge-props": "^1.2.1", "axios": "^0.21.1", "classnames": "^2.3.1", "enquire.js": "^2.1.6", "hi-ui": "^1.1.319", "lodash": "^4.17.21", "md5": "^2.3.0", "qs": "^6.10.1", "screenfull": "^5.1.0", "sortablejs": "^1.13.0", "vue": "^2.6.12", "vue-draggable-resizable": "^2.3.0", "vue-gemini-scrollbar": "^2.0.1", "vue-jstree": "^2.1.6", "vue-router": "^3.5.1", "vuex": "^3.6.2" }, "devDependencies": { "@babel/core": "^7.14.5", "@babel/plugin-transform-runtime": "^7.14.5", "@babel/preset-env": "^7.14.5", "@vitejs/plugin-vue-jsx": "^1.1.5", "@vue/babel-plugin-transform-vue-jsx": "^1.2.1", "@vue/babel-preset-jsx": "^1.2.4", "babel-loader": "^8.2.2", "babel-plugin-component": "^1.1.1", "babel-plugin-syntax-jsx": "^6.18.0", "babel-plugin-transform-vite-meta-env": "^1.0.3", "css-loader": "^0.28.7", "dotenv": "^10.0.0", "extract-text-webpack-plugin": "^3.0.2", "file-loader": "^1.1.5", "html-webpack-plugin": "^3.2.0", "less": "^2.7.3", "less-loader": "^3.0.0", "optimize-css-assets-webpack-plugin": "^3.2.0", "parallel-webpack": "^2.6.0", "postcss-import": "^11.0.0", "postcss-loader": "^2.0.9", "postcss-url": "^7.3.0", "semver": "^5.4.1", "shelljs": "^0.7.8", "svg-sprite-loader": "^3.5.2", "uglifyjs-webpack-plugin": "^1.1.3", "url-loader": "^0.6.2", "vite": "^2.2.4", "vite-plugin-html": "^2.0.7", "vite-plugin-pagedata": "^1.0.3", "vite-plugin-vue2": "^1.6.2", "vue-loader": "^13.5.0", "vue-style-loader": "^3.0.3", "vue-template-compiler": "^2.6.12", "webpack": "^3.12.0", "webpack-bundle-analyzer": "^4.4.2", "webpack-merge": "^4.1.1" }, "engines": { "node": ">= 6.0.0", "npm": ">= 3.0.0" } }
Ignore Space
Show notes
View
processes.json
{ "apps": [ { "name": "vite-work", "cwd": "./", "script": "./build/bin/pm2.js", "args":"--host", "log_date_format": "YYYY-MM-DD HH:mm:ss", "error_file": "./hi-vui-logs/node-app.stderr.log", "out_file": "./hi-vui-logs/node-app.stdout.log", "pid_file": "./hi-vui-logs/node-geo-api.pid", "instances": 2, "min_uptime": "60s", "max_restarts": 100000, "max_memory_restart": "512M", "watch": true, "ignore_watch": ["hi-vui-logs","eaptpl","eaptpl_backup","test","build","config","node_modules"], "merge_logs": true, "exec_interpreter": "node", "exec_mode": "cluster", "autorestart": false, "vizion": false } ] }
{ "apps": [ { "name": "vite-work", "cwd": "./", "script": "./build/bin/pm2.js", "log_date_format": "YYYY-MM-DD HH:mm:ss", "error_file": "./hi-vui-logs/node-app.stderr.log", "out_file": "./hi-vui-logs/node-app.stdout.log", "pid_file": "./hi-vui-logs/node-geo-api.pid", "instances": 2, "min_uptime": "60s", "max_restarts": 100000, "max_memory_restart": "512M", "watch": true, "ignore_watch": ["hi-vui-logs","eaptpl","eaptpl_backup","test","build","config","node_modules"], "merge_logs": true, "exec_interpreter": "node", "exec_mode": "cluster", "autorestart": false, "vizion": false } ] }
Ignore Space
Show notes
View
可编译版package.json
{ "name": "hi-vui-template", "version": "1.0.2", "description": "A hi-vui-template project", "author": "caibinghong <caibinghong@163.com>", "scripts": { "pm2:start": "npm run rm:vite && pm2 start processes.json", "pm2:restart": "npm run rm:vite && pm2 restart all", "pm2:stop": "pm2 stop all", "pm2:log": "pm2 logs ", "pm2:cpu": "pm2 monit ", "pm2:kill": "pm2 delete all", "dev": "vite --host", "vite-build": "vite build", "vite-serve": "vite preview", "start": "npm run dev", "run": "node build/run.js", "build": "node build/build.js", "build:login": "node build/build.js ./project/hivuiLogin", "build:main": "node build/build.js ./project/hivuiMain" }, "dependencies": { "@babel/runtime-corejs3": "^7.14.6", "@vue/babel-helper-vue-jsx-merge-props": "^1.2.1", "axios": "^0.21.1", "classnames": "^2.3.1", "enquire.js": "^2.1.6", "hi-ui": "^1.1.319", "lodash": "^4.17.21", "md5": "^2.3.0", "qs": "^6.10.1", "screenfull": "^5.1.0", "sortablejs": "^1.13.0", "vue": "^2.6.12", "vue-draggable-resizable": "^2.3.0", "vue-gemini-scrollbar": "^2.0.1", "vue-jstree": "^2.1.6", "vue-router": "^3.5.1", "vuex": "^3.6.2" }, "devDependencies": { "@babel/core": "^7.14.5", "@babel/plugin-transform-runtime": "^7.14.5", "@babel/preset-env": "^7.14.5", "@vitejs/plugin-vue-jsx": "^1.1.5", "@vue/babel-plugin-transform-vue-jsx": "^1.2.1", "@vue/babel-preset-jsx": "^1.2.4", "babel-loader": "^8.2.2", "babel-plugin-component": "^1.1.1", "babel-plugin-syntax-jsx": "^6.18.0", "babel-plugin-transform-vite-meta-env": "^1.0.3", "css-loader": "^0.28.7", "dotenv": "^10.0.0", "extract-text-webpack-plugin": "^3.0.2", "file-loader": "^1.1.5", "html-webpack-plugin": "^3.2.0", "less": "^2.7.3", "less-loader": "^3.0.0", "optimize-css-assets-webpack-plugin": "^3.2.0", "parallel-webpack": "^2.6.0", "postcss-import": "^11.0.0", "postcss-loader": "^2.0.9", "postcss-url": "^7.3.0", "semver": "^5.4.1", "shelljs": "^0.7.8", "svg-sprite-loader": "^3.5.2", "uglifyjs-webpack-plugin": "^1.1.3", "url-loader": "^0.6.2", "vite": "^2.2.4", "vite-plugin-html": "^2.0.7", "vite-plugin-pagedata": "^1.0.3", "vite-plugin-vue2": "^1.6.2", "vue-loader": "^13.5.0", "vue-style-loader": "^3.0.3", "vue-template-compiler": "^2.6.12", "webpack": "^3.12.0", "webpack-bundle-analyzer": "^4.4.2", "webpack-merge": "^4.1.1" }, "engines": { "node": ">= 6.0.0", "npm": ">= 3.0.0" } }
{ "name": "hi-vui-template", "version": "1.0.2", "description": "A hi-vui-template project", "author": "caibinghong <caibinghong@163.com>", "scripts": { "dev": "vite --host", "vite-build": "vite build", "vite-serve": "vite preview", "start": "npm run dev", "run": "node build/run.js", "build": "node build/build.js", "build-list": "node build/build.js ./project/hivuiLogin", "build-list1": "node build/build.js ./project/hivuiMain" }, "dependencies": { "@babel/runtime-corejs3": "^7.14.6", "@vue/babel-helper-vue-jsx-merge-props": "^1.2.1", "axios": "^0.21.1", "classnames": "^2.3.1", "enquire.js": "^2.1.6", "hi-ui": "^1.1.319", "lodash": "^4.17.21", "md5": "^2.3.0", "qs": "^6.10.1", "screenfull": "^5.1.0", "sortablejs": "^1.13.0", "vue": "^2.6.12", "vue-draggable-resizable": "^2.3.0", "vue-gemini-scrollbar": "^2.0.1", "vue-jstree": "^2.1.6", "vue-router": "^3.5.1", "vuex": "^3.6.2" }, "devDependencies": { "@babel/core": "^7.14.5", "@babel/plugin-transform-runtime": "^7.14.5", "@babel/preset-env": "^7.14.5", "@vitejs/plugin-vue-jsx": "^1.1.5", "@vue/babel-plugin-transform-vue-jsx": "^1.2.1", "@vue/babel-preset-jsx": "^1.2.4", "babel-loader": "^8.2.2", "babel-plugin-component": "^1.1.1", "babel-plugin-syntax-jsx": "^6.18.0", "babel-plugin-transform-vite-meta-env": "^1.0.3", "css-loader": "^0.28.7", "dotenv": "^10.0.0", "extract-text-webpack-plugin": "^3.0.2", "file-loader": "^1.1.5", "html-webpack-plugin": "^3.2.0", "less": "^2.7.3", "less-loader": "^3.0.0", "optimize-css-assets-webpack-plugin": "^3.2.0", "parallel-webpack": "^2.6.0", "postcss-import": "^11.0.0", "postcss-loader": "^2.0.9", "postcss-url": "^7.3.0", "semver": "^5.4.1", "shelljs": "^0.7.8", "svg-sprite-loader": "^3.5.2", "uglifyjs-webpack-plugin": "^1.1.3", "url-loader": "^0.6.2", "vite": "^2.2.4", "vite-plugin-html": "^2.0.7", "vite-plugin-pagedata": "^1.0.3", "vite-plugin-vue2": "^1.6.2", "vue-loader": "^13.5.0", "vue-style-loader": "^3.0.3", "vue-template-compiler": "^2.6.12", "webpack": "^3.12.0", "webpack-bundle-analyzer": "^4.4.2", "webpack-merge": "^4.1.1" }, "engines": { "node": ">= 6.0.0", "npm": ">= 3.0.0" } }
Show line notes below