index.js 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. // see http://vuejs-templates.github.io/webpack for documentation.
  2. var path = require('path')
  3. var domain = 'http://www.api.com';
  4. // var domain = 'http://api.omwteam.com/api';
  5. module.exports = {
  6. build: {
  7. env: require('./prod.env'),
  8. index: path.resolve(__dirname, '../dist/index.html'),
  9. assetsRoot: path.resolve(__dirname, '../dist'),
  10. assetsSubDirectory: 'static',
  11. assetsPublicPath: '/',
  12. productionSourceMap: true,
  13. // Gzip off by default as many popular static hosts such as
  14. // Surge or Netlify already gzip all static assets for you.
  15. // Before setting to `true`, make sure to:
  16. // npm install --save-dev compression-webpack-plugin
  17. productionGzip: false,
  18. productionGzipExtensions: ['js', 'css']
  19. },
  20. dev: {
  21. env: require('./dev.env'),
  22. port: 8080,
  23. assetsSubDirectory: 'static',
  24. assetsPublicPath: '/',
  25. proxyTable: {
  26. '/info':{
  27. target: domain,
  28. changeOrigin:true,
  29. },
  30. '/user':{
  31. target: domain,
  32. changeOrigin:true,
  33. },
  34. '/menu':{
  35. target: domain,
  36. changeOrigin:true,
  37. },
  38. '/demand':{
  39. target: domain,
  40. changeOrigin:true,
  41. },
  42. '/upload':{
  43. target: domain,
  44. changeOrigin:true,
  45. }
  46. },
  47. // CSS Sourcemaps off by default because relative paths are "buggy"
  48. // with this option, according to the CSS-Loader README
  49. // (https://github.com/webpack/css-loader#sourcemaps)
  50. // In our experience, they generally work as expected,
  51. // just be aware of this issue when enabling this option.
  52. cssSourceMap: false
  53. }
  54. }