From c2109f0e7848b965a53c7076cd87706029ed7daa Mon Sep 17 00:00:00 2001 From: sunniejs <13611823420@163.com> Date: Thu, 24 Dec 2020 09:24:21 +0800 Subject: [PATCH] Fix config environment bug --- babel.config.js | 2 +- src/api/home.js | 3 +-- src/config/index.js | 4 ++-- vue.config.js | 1 - 4 files changed, 4 insertions(+), 6 deletions(-) diff --git a/babel.config.js b/babel.config.js index 0355640..fc13e17 100644 --- a/babel.config.js +++ b/babel.config.js @@ -17,6 +17,6 @@ if (IS_PROD) { } module.exports = { - presets: [['@vue/cli-plugin-babel/preset', {useBuiltIns: 'usage', corejs: 3}]], + presets: [['@vue/cli-plugin-babel/preset', { useBuiltIns: 'usage', corejs: 3 }]], plugins } diff --git a/src/api/home.js b/src/api/home.js index 4239f3b..c6ddc7a 100644 --- a/src/api/home.js +++ b/src/api/home.js @@ -1,6 +1,5 @@ // import qs from 'qs' // axios // import request from '@/utils/request' -//home api +// home api - \ No newline at end of file diff --git a/src/config/index.js b/src/config/index.js index d3dfad9..0f8598f 100644 --- a/src/config/index.js +++ b/src/config/index.js @@ -1,4 +1,4 @@ -//根据环境引入不同配置 process.env.NODE_ENV -const environment = process.env.NODE_ENV || 'development' +// 根据环境引入不同配置 process.env.VUE_APP_ENV +const environment = process.env.VUE_APP_ENV || 'production' const config = require('./env.' + environment) module.exports = config diff --git a/vue.config.js b/vue.config.js index a301795..d80ed0a 100644 --- a/vue.config.js +++ b/vue.config.js @@ -8,7 +8,6 @@ const resolve = dir => path.join(__dirname, dir) const name = defaultSettings.title || 'vue mobile template' // 生产环境,测试和正式 const IS_PROD = ['production', 'prod'].includes(process.env.NODE_ENV) - // externals // const externals = { // vue: 'Vue',