From 9279ebb0f924d822777555fbead6d7208e2f82cd Mon Sep 17 00:00:00 2001 From: Jason Date: Wed, 22 Sep 2021 13:30:43 +0800 Subject: [PATCH] env --- .env | 6 ------ .env.development | 6 ------ .env.example | 8 ++++++++ .gitignore | 3 +++ vue.config.js | 27 +++++++++++++++++++++++++-- 5 files changed, 36 insertions(+), 14 deletions(-) delete mode 100644 .env delete mode 100644 .env.development create mode 100644 .env.example diff --git a/.env b/.env deleted file mode 100644 index f864a92..0000000 --- a/.env +++ /dev/null @@ -1,6 +0,0 @@ -NODE_ENV=development -BASE_URL=/ -VUE_APP_TITLE=Jason.Chen -VUE_APP_API_URL=http://api.dsp-test.shangkelian.cn/api -VUE_APP_USERNAME= -VUE_APP_PASSWORD= diff --git a/.env.development b/.env.development deleted file mode 100644 index 911eb13..0000000 --- a/.env.development +++ /dev/null @@ -1,6 +0,0 @@ -NODE_ENV=development -BASE_URL=/ -VUE_APP_TITLE=Jason.Chen -VUE_APP_API_URL=http://api.dsp-test.shangkelian.cn/api -VUE_APP_USERNAME=15555555555 -VUE_APP_PASSWORD=123123 diff --git a/.env.example b/.env.example new file mode 100644 index 0000000..5b02577 --- /dev/null +++ b/.env.example @@ -0,0 +1,8 @@ +NODE_ENV=production +BASE_URL=/ + +VUE_APP_TITLE=Jason.Chen +VUE_APP_API_URL=/api + +VUE_APP_USERNAME= +VUE_APP_PASSWORD= diff --git a/.gitignore b/.gitignore index 403adbc..8aa6837 100644 --- a/.gitignore +++ b/.gitignore @@ -7,6 +7,9 @@ node_modules .env.local .env.*.local +.env +.env.development + # Log files npm-debug.log* yarn-debug.log* diff --git a/vue.config.js b/vue.config.js index 922d42c..d8e53c4 100644 --- a/vue.config.js +++ b/vue.config.js @@ -1,6 +1,19 @@ -module.exports = { - assetsDir: 'static', // 配置js、css静态资源二级目录的位置 +const path = require('path') +function resolve (dir) { + return path.join(__dirname, dir) +} + +module.exports = { + configureWebpack: { + resolve: { + alias: { + '@': resolve('src') + } + } + }, + assetsDir: 'static', // 配置js、css静态资源二级目录的位置 + outputDir: 'dist', css: { loaderOptions: { less: { @@ -8,4 +21,14 @@ module.exports = { } } } + // devServer: { + // proxy: { + // '/api': { + // target: '', + // pathRewrite: { + // '^/api': '' + // } + // } + // } + // } }