index.js 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. 'use strict'
  2. const path = require('path')
  3. module.exports = {
  4. dev: {
  5. assetsSubDirectory: 'static',
  6. assetsPublicPath: '/',
  7. proxyTable: {
  8. '/api': {
  9. target: 'http://localhost:8081',//后端接口地址
  10. changeOrigin: true, //是否跨域
  11. pathRewrite: {
  12. '^/api': '/',//重写,
  13. }
  14. }
  15. },
  16. // 本地开发使用
  17. host: 'localhost',
  18. port: 9527,
  19. autoOpenBrowser: true,
  20. errorOverlay: true,
  21. notifyOnErrors: false,
  22. poll: false,
  23. useEslint: true,
  24. showEslintErrorsInOverlay: false,
  25. devtool: 'cheap-source-map',
  26. cssSourceMap: false
  27. },
  28. build: {
  29. index: path.resolve(__dirname, '../dist/index.html'),
  30. assetsRoot: path.resolve(__dirname, '../dist'),
  31. assetsSubDirectory: 'static',
  32. assetsPublicPath: '/',
  33. productionSourceMap: false,
  34. devtool: 'source-map',
  35. productionGzip: false,
  36. productionGzipExtensions: ['js', 'css'],
  37. bundleAnalyzerReport: process.env.npm_config_report || false,
  38. generateAnalyzerReport: process.env.npm_config_generate_report || false
  39. }
  40. }