webpack在vue项目中根据不同环境配置通用路径

let apiOne = {
  production: '/apiOne',
  development: '/api',
  testing: 'api',
  presentation: 'api'
}
let apiTwo = {
  production: '/apiTwo',
  development: '/api',
  testing: 'api',
  presentation: 'api'
}
export const pathOne = apiOne[process.env.NODE_ENV || 'development'];
export const pathTwo = apiTwo[process.env.NODE_ENV || 'development'];

你可能感兴趣的:(webpack)