I have a config file in my vue.js + webpack + npm project
/plugins/http/GLOBAL_CONST.js
const GLOBAL_CONST = {}
GLOBAL_CONST.BASE_URL = "http://www.example.com/" // "http://localhost:3000/"
GLOBAL_CONST.BASE_API = "http://www.example:8000/" // "http://localhost:8000/"
export default GLOBAL_CONST
I have a requirement, if I run npm run dev
, the
GLOBAL_CONST.BASE_URL = "http://localhost:3000/"
GLOBAL_CONST.BASE_API = "http://localhost:8000/"
if I run npm run build
it use:
GLOBAL_CONST.BASE_URL = "http://www.example.com/"
GLOBAL_CONST.BASE_API = "http://www.example:8000/"
is it possible to make it come true?