Ver Fonte

chore: change development configuration

zhangyuhan há 3 anos atrás
pai
commit
a01037b905
5 ficheiros alterados com 15 adições e 5 exclusões
  1. 1 1
      .env.development
  2. 1 2
      .env.production
  3. 3 1
      config/dev-proxy.js
  4. 1 1
      src/router/index.js
  5. 9 0
      vue.config.js

+ 1 - 1
.env.development

@@ -1,7 +1,7 @@
 NODE_ENV=development
 VUE_APP_BASE_API='/api'
 VUE_APP_API_MOCK=true
-VUE_APP_BASE_URL='/'
 VUE_APP_TEMPLATE=true
 VUE_APP_ID=10000
+VUE_APP_BASE_URL='/home'
 VUE_APP_BASE_PUBLIC='/'

+ 1 - 2
.env.production

@@ -1,7 +1,6 @@
 NODE_ENV=production
 VUE_APP_BASE_API=''
 VUE_APP_API_MOCK=true
-VUE_APP_BASE_URL='/work'
 VUE_APP_TEMPLATE=true
 VUE_APP_ID=10000
-VUE_APP_BASE_PUBLIC='/work/'
+VUE_APP_BASE_PUBLIC='/home'

+ 3 - 1
config/dev-proxy.js

@@ -31,7 +31,9 @@ function getProxy (prefix) {
   }
 }
 
-['dataExport', 'pccss', 'course', 'public-pc', 'js', 'css', 'jypay', 'subscribepay', 'front', 'common-module'].forEach(v => {
+['dataExport', 'pccss', 'course', 'public-pc', 'js', 'css', 'jypay', 'subscribepay', 'front', 'common-module',
+  'page_big_pc'
+].forEach(v => {
   const temp = getProxy(v)
   proxy[temp.key] = temp.value
 })

+ 1 - 1
src/router/index.js

@@ -44,7 +44,7 @@ routes.push({
 
 const createRouter = () => new VueRouter({
   mode: 'history',
-  base: process.env.BASE_URL,
+  base: process.env.VUE_APP_BASE_URL,
   scrollBehavior: () => ({ x: 0, y: 0 }),
   routes
 })

+ 9 - 0
vue.config.js

@@ -1,5 +1,10 @@
 const { defineConfig } = require('@vue/cli-service')
 const proxy = require('./config/dev-proxy')
+const path = require('path')
+
+function resolve (dir) {
+  return path.join(__dirname, dir)
+}
 
 module.exports = defineConfig({
   transpileDependencies: true,
@@ -12,5 +17,9 @@ module.exports = defineConfig({
       'Access-Control-Allow-Origin': '*'
     },
     proxy: proxy
+  },
+  chainWebpack: config => {
+    config.resolve.alias
+      .set('@public', resolve('public'))
   }
 })