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
0 parent
commit
eb9a5dabdca2009201db094c30bbb8b42b07e210
caibinghong
authored
on 19 May 2021
Showing
10 changed files
.babelrc
.editorconfig
.eslintignore
.eslintrc.js
.gitignore
.postcssrc.js
build
doc.txt
index.html
package.json
Ignore Space
Show notes
View
.babelrc
{ "presets": [ ["env", { "modules": false, "targets": { "browsers": ["> 1%", "last 2 versions", "not ie <= 8"] } }], "stage-2" ], "plugins": ["transform-vue-jsx", "transform-runtime", [ "component", { "libraryName": "hi-ui", "style": false } ]], "env": { "test": { "presets": ["env", "stage-2"], "plugins": ["transform-vue-jsx", "istanbul"] } } }
Ignore Space
Show notes
View
.editorconfig
root = true [*] charset = utf-8 indent_style = space indent_size = 2 end_of_line = lf insert_final_newline = true trim_trailing_whitespace = true
Ignore Space
Show notes
View
.eslintignore
/build/ /config/ /dist/ /*.js /test/unit/coverage/
Ignore Space
Show notes
View
.eslintrc.js
// https://eslint.org/docs/user-guide/configuring module.exports = { root: true, parserOptions: { parser: 'babel-eslint' }, env: { browser: true, }, extends: [ // https://github.com/vuejs/eslint-plugin-vue#priority-a-essential-error-prevention // consider switching to `plugin:vue/strongly-recommended` or `plugin:vue/recommended` for stricter rules. 'plugin:vue/essential', // https://github.com/standard/standard/blob/master/docs/RULES-en.md 'standard' ], // required to lint *.vue files plugins: [ 'vue' ], // add your custom rules here rules: { // allow async-await 'generator-star-spacing': 'off', // allow debugger during development 'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off' } }
Ignore Space
Show notes
View
.gitignore
.DS_Store node_modules/ /dist/ npm-debug.log* yarn-debug.log* yarn-error.log* /test/unit/coverage/ /test/e2e/reports/ selenium-debug.log # Editor directories and files .idea .vscode *.suo *.ntvs* *.njsproj *.sln
Ignore Space
Show notes
View
.postcssrc.js
// https://github.com/michael-ciniawsky/postcss-load-config module.exports = { "plugins": { "postcss-import": {}, "postcss-url": {}, // to edit target browsers: use "browserslist" field in package.json "autoprefixer": {} } }
Ignore Space
Show notes
View
build
Not supported
Ignore Space
Show notes
View
doc.txt
webpack 多config 编译执行 https://cloud.tencent.com/developer/section/1477277 项目文件:/filesdisk2/eap5/web/workspace/eaptpl/deploy 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 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 } ]], Webpack 打包太慢?来试试 Bundleless https://mp.weixin.qq.com/s/aNvk6dMsDz3O9TVtU6djLQ bundleless一次探索记录 snowpack 第一次看到 bundleless 这个单词是从一篇博文上,随后知道了 snowpack。关键词:不打包的构建工具、替代 webpack、ESM、vite...... 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
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width,initial-scale=1.0"> <title>vue-multipage</title> </head> <body> 我是通用模板 <div id="app"></div> <script src="//cdn.bootcss.com/vue/2.5.7/vue.min.js"></script> <script src="//cdn.bootcss.com/vuex/3.0.1/vuex.min.js"></script> <!-- <script src="//cdn.bootcss.com/element-ui/2.2.0/index.js"></script> --> <!-- built files will be auto injected --> </body> </html>
Ignore Space
Show notes
View
package.json
{ "name": "vue-multipage", "version": "1.0.0", "description": "A Vue.js project", "author": "jiangyan <yan.jiang@kindroid.com>", "private": true, "scripts": { "vite-dev": "vite", "vite-build": "vite build", "vite-serve": "vite preview", "dev": "webpack-dev-server --inline --progress --config build/webpack.dev.conf.js", "start": "npm run dev", "unit": "cross-env BABEL_ENV=test karma start test/unit/karma.conf.js --single-run", "e2e": "node test/e2e/runner.js", "test": "npm run unit && npm run e2e", "lint": "eslint --ext .js,.vue src test/unit test/e2e/specs", "build": "node build/build.js", "build-list": "node build/build.js ./src/modules/a", "build-watch": "node build/build-watch.js", "build-dev": "cross-env BABEL_ENV=dev" }, "dependencies": { "hi-ui": "^1.1.293", "lodash": "^4.17.21", "vue": "^2.6.12", "vue-router": "^3.0.1" }, "devDependencies": { "@vitejs/plugin-vue": "^1.2.2", "@vue/compiler-sfc": "^3.0.11", "autoprefixer": "^7.1.2", "babel-core": "^6.22.1", "babel-eslint": "^8.2.1", "babel-helper-vue-jsx-merge-props": "^2.0.3", "babel-loader": "^7.1.1", "babel-plugin-component": "^1.1.1", "babel-plugin-istanbul": "^4.1.1", "babel-plugin-syntax-jsx": "^6.18.0", "babel-plugin-transform-runtime": "^6.22.0", "babel-plugin-transform-vue-jsx": "^3.5.0", "babel-preset-env": "^1.3.2", "babel-preset-stage-2": "^6.22.0", "babel-register": "^6.22.0", "chai": "^4.1.2", "chalk": "^2.0.1", "copy-webpack-plugin": "^4.0.1", "cross-env": "^5.0.1", "cross-spawn": "^5.0.1", "css-loader": "^0.28.0", "eslint": "^4.15.0", "eslint-config-standard": "^10.2.1", "eslint-friendly-formatter": "^3.0.0", "eslint-loader": "^1.7.1", "eslint-plugin-import": "^2.7.0", "eslint-plugin-node": "^5.2.0", "eslint-plugin-promise": "^3.4.0", "eslint-plugin-standard": "^3.0.1", "eslint-plugin-vue": "^4.0.0", "extract-text-webpack-plugin": "^3.0.0", "file-loader": "^1.1.4", "friendly-errors-webpack-plugin": "^1.6.1", "happypack": "^5.0.1", "html-webpack-plugin": "^2.30.1", "inject-loader": "^3.0.0", "karma": "^1.4.1", "karma-coverage": "^1.1.1", "karma-mocha": "^1.3.0", "karma-phantomjs-launcher": "^1.0.2", "karma-phantomjs-shim": "^1.4.0", "karma-sinon-chai": "^1.3.1", "karma-sourcemap-loader": "^0.3.7", "karma-spec-reporter": "0.0.31", "karma-webpack": "^2.0.2", "less": "^4.1.1", "less-loader": "^3.0.0", "mocha": "^3.2.0", "nightwatch": "^0.9.12", "node-notifier": "^5.1.2", "node-sass": "^4.13.0", "optimize-css-assets-webpack-plugin": "^3.2.0", "ora": "^1.2.0", "phantomjs-prebuilt": "^2.1.14", "portfinder": "^1.0.13", "postcss-import": "^11.0.0", "postcss-loader": "^2.0.8", "postcss-url": "^7.2.1", "rimraf": "^2.6.0", "sass-loader": "^8.0.2", "selenium-server": "^3.0.1", "semver": "^5.3.0", "shelljs": "^0.7.6", "sinon": "^4.0.0", "sinon-chai": "^2.8.0", "uglifyjs-webpack-plugin": "^1.1.1", "url-loader": "^0.5.8", "vite": "^2.2.4", "vite-plugin-vue2": "^1.5.1", "vue-loader": "^13.3.0", "vue-style-loader": "^3.0.1", "vue-template-compiler": "^2.6.12", "webpack": "^3.6.0", "webpack-bundle-analyzer": "^2.9.0", "webpack-dev-server": "^2.9.1", "webpack-merge": "^4.1.0", "webpackbar": "^5.0.0-3" }, "engines": { "node": ">= 6.0.0", "npm": ">= 3.0.0" }, "browserslist": [ "> 1%", "last 2 versions", "not ie <= 8" ] }
Show line notes below