Commit a6f47933999f1cf9e485eca3d3b7369d68ad8bb6

Authored by ly525
1 parent 20174ec7

build: deploy to github pages

front-end/h5/.eslintrc.js
... ... @@ -8,7 +8,7 @@ module.exports = {
8 8 '@vue/standard'
9 9 ],
10 10 rules: {
11   - 'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'off',
  11 + 'no-console': process.env.NODE_ENV === 'production' ? 'off' : 'off',
12 12 'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off'
13 13 },
14 14 parserOptions: {
... ...
front-end/h5/deploy.sh 0 → 100755
  1 +#!/usr/bin/env sh
  2 +# deploy guide: https://cli.vuejs.org/guide/deployment.html#platform-guides
  3 +
  4 +# abort on errors
  5 +set -e
  6 +
  7 +# build
  8 +npm run build
  9 +
  10 +# navigate into the build output directory
  11 +cd dist
  12 +
  13 +# if you are deploying to a custom domain
  14 +# echo 'www.example.com' > CNAME
  15 +
  16 +git init
  17 +git add -A
  18 +git commit -m 'deploy'
  19 +
  20 +# if you are deploying to https://<USERNAME>.github.io
  21 +# git push -f git@github.com:<USERNAME>/<USERNAME>.github.io.git master
  22 +
  23 +# if you are deploying to https://<USERNAME>.github.io/<REPO>
  24 +git push -f git@github.com:ly525/luban-h5.git master:gh-pages
  25 +
  26 +cd -
0 27 \ No newline at end of file
... ...
front-end/h5/package.json
... ... @@ -7,7 +7,8 @@
7 7 "build": "vue-cli-service build",
8 8 "lint": "vue-cli-service lint",
9 9 "test:e2e": "vue-cli-service test:e2e",
10   - "test:unit": "vue-cli-service test:unit"
  10 + "test:unit": "vue-cli-service test:unit",
  11 + "deploy": "rm -rf dist && npm run build && ./deploy.sh"
11 12 },
12 13 "dependencies": {
13 14 "ant-design-vue": "^1.3.10",
... ...
front-end/h5/vue.config.js
1 1 module.exports = {
2   - runtimeCompiler: true
  2 + runtimeCompiler: true,
  3 + publicPath: process.env.NODE_ENV === 'production'
  4 + ? '/luban-h5/'
  5 + : '/'
3 6 }
... ...