index.js 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. 'use strict'
  2. // Template version: 1.3.1
  3. // see http://vuejs-templates.github.io/webpack for documentation.
  4. const path = require('path')
  5. const proxyTable = {
  6. '/api': {
  7. // target: 'http://mbi.sagacloud.cn:8080', //扫楼revit
  8. target: 'http://192.168.20.235:8080', //扫楼revit
  9. changeOrigin: true,
  10. pathRewrite: {
  11. '^/api': ''
  12. }
  13. },
  14. '/sass': {
  15. target: 'http://192.168.30.96:8080', //sass平台
  16. changeOrigin: true,
  17. pathRewrite: {
  18. '^/sass': ''
  19. }
  20. },
  21. '/img': {
  22. target: 'http://192.168.20.225:8080',
  23. changeOrigin: true,
  24. pathRewrite: {
  25. '^/img': ''
  26. }
  27. },
  28. '/physics': {
  29. // target: 'http://101.200.32.13:28888',
  30. target: 'http://192.168.20.225:8080',
  31. changeOrigin: true,
  32. pathRewrite: {
  33. '^/physics': ''
  34. }
  35. },
  36. '/seeImg': {
  37. target: 'http://172.16.0.181:8890',
  38. changeOrigin: true,
  39. pathRewrite: {
  40. '^/seeImg': ''
  41. }
  42. },
  43. '/arithmetic': {
  44. target: 'http://api.sagacloud.cn/pythonserver/',
  45. changeOrigin: true,
  46. pathRewrite: {
  47. '^/arithmetic': ''
  48. }
  49. },
  50. }
  51. module.exports = {
  52. dev: {
  53. // Paths
  54. assetsSubDirectory: 'static',
  55. assetsPublicPath: '/',
  56. // Various Dev Server settings
  57. host: '0.0.0.0', // can be overwritten by process.env.HOST
  58. port: 8091, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined
  59. autoOpenBrowser: true,
  60. errorOverlay: true,
  61. notifyOnErrors: true,
  62. poll: false, // https://webpack.js.org/configuration/dev-server/#devserver-watchoptions-
  63. proxyTable: proxyTable,
  64. /**
  65. * Source Maps
  66. */
  67. productionGzip: true,
  68. productionGzipExtensions: ['js', 'css'],
  69. // https://webpack.js.org/configuration/devtool/#development
  70. devtool: 'cheap-module-eval-source-map',
  71. // If you have problems debugging vue-files in devtools,
  72. // set this to false - it *may* help
  73. // https://vue-loader.vuejs.org/en/options.html#cachebusting
  74. cacheBusting: true,
  75. cssSourceMap: true
  76. },
  77. build: {
  78. // Template for index.html
  79. index: path.resolve(__dirname, '../dist/index.html'),
  80. // Paths
  81. assetsRoot: path.resolve(__dirname, '../dist'),
  82. assetsSubDirectory: 'static',
  83. assetsPublicPath: '/',
  84. /**
  85. * Source Maps
  86. */
  87. productionSourceMap: true,
  88. // https://webpack.js.org/configuration/devtool/#production
  89. devtool: '#source-map',
  90. // Gzip off by default as many popular static hosts such as
  91. // Surge or Netlify already gzip all static assets for you.
  92. // Before setting to `true`, make sure to:
  93. // npm install --save-dev compression-webpack-plugin
  94. productionGzip: true,
  95. productionGzipExtensions: ['js', 'css'],
  96. // Run the build command with an extra argument to
  97. // View the bundle analyzer report after build finishes:
  98. // `npm run build --report`
  99. // Set to `true` or `false` to always turn it on or off
  100. bundleAnalyzerReport: process.env.npm_config_report
  101. }
  102. }