index.js 1.0 KB

123456789101112131415161718192021222324252627282930313233
  1. var path = require('path')
  2. module.exports = {
  3. build: {
  4. env: require('./prod.env'),
  5. index: path.resolve(__dirname, '../dist/index.html'),
  6. assetsRoot: path.resolve(__dirname, '../dist'),
  7. assetsSubDirectory: 'static',
  8. assetsPublicPath: '/vue-admin/',
  9. productionSourceMap: true,
  10. productionGzip: false,
  11. productionGzipExtensions: ['js', 'css'],
  12. bundleAnalyzerReport: process.env.npm_config_report
  13. },
  14. dev: {
  15. env: require('./dev.env'),
  16. port: 8090,
  17. autoOpenBrowser: true,
  18. assetsSubDirectory: 'static',
  19. assetsPublicPath: '/',
  20. proxyTable: {
  21. '/api': {
  22. target: 'http://192.168.101.6:8098', // 接口域名 开发
  23. secure: true, // 如果是https接口,需要配置这个参数
  24. changeOrigin: true, //是否跨域
  25. pathRewrite: { // 如果接口本身没有api的路径,那么这里将发送到后端的请求重写为没有api的路径
  26. '^/api': '/'
  27. }
  28. }
  29. },
  30. cssSourceMap: false
  31. }
  32. }