index.js 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. /*
  2. * This file is part of Qingyun SmartPark.
  3. *
  4. * @description 青云智慧园区
  5. * @link https://sdqingyun.cn
  6. * @contact https://sdqingyun.cn 7*12 9:00-21:00
  7. */
  8. 'use strict'
  9. // Template version: 1.2.6
  10. // see http://vuejs-templates.github.io/webpack for documentation.
  11. const path = require('path')
  12. module.exports = {
  13. dev: {
  14. // Paths
  15. assetsSubDirectory: 'static',
  16. assetsPublicPath: '/',
  17. proxyTable: {
  18. '/api': {
  19. target: 'http://zhgd.sdyingfeng.cn/',
  20. changeOrigin: true,
  21. pathRewrite: {
  22. '^/api': ''
  23. }
  24. },
  25. '/file': {
  26. target: 'http://zhgd.sdyingfeng.cn/',//此处代理的不对,待完善
  27. changeOrigin: true,
  28. pathRewrite: {
  29. '^/file': ''
  30. }
  31. },
  32. },
  33. // Various Dev Server settings
  34. host: '127.0.0.1', // can be overwritten by process.env.HOST
  35. port: 8449, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined
  36. autoOpenBrowser: false,
  37. errorOverlay: true,
  38. notifyOnErrors: false,
  39. poll: false, // https://webpack.js.org/configuration/dev-server/#devserver-watchoptions-
  40. // Use Eslint Loader?
  41. // If true, your code will be linted during bundling and
  42. // linting errors and warnings will be shown in the console.
  43. useEslint: true,
  44. // If true, eslint errors and warnings will also be shown in the error overlay
  45. // in the browser.
  46. showEslintErrorsInOverlay: false,
  47. /**
  48. * Source Maps
  49. */
  50. // https://webpack.js.org/configuration/devtool/#development
  51. devtool: 'cheap-source-map',
  52. // CSS Sourcemaps off by default because relative paths are "buggy"
  53. // with this option, according to the CSS-Loader README
  54. // (https://github.com/webpack/css-loader#sourcemaps)
  55. // In our experience, they generally work as expected,
  56. // just be aware of this issue when enabling this option.
  57. cssSourceMap: false
  58. },
  59. build: {
  60. // Template for index.html
  61. index: path.resolve(__dirname, '../dist/index.html'),
  62. // Paths
  63. assetsRoot: path.resolve(__dirname, '../dist'),
  64. assetsSubDirectory: 'static',
  65. /**
  66. * You can set by youself according to actual condition
  67. * You will need to set this if you plan to deploy your site under a sub path,
  68. * for example GitHub pages. If you plan to deploy your site to https://foo.github.io/bar/,
  69. * then assetsPublicPath should be set to "/bar/".
  70. * In most cases please use '/' !!!
  71. */
  72. assetsPublicPath: './',
  73. /**
  74. * Source Maps
  75. */
  76. productionSourceMap: false,
  77. // https://webpack.js.org/configuration/devtool/#production
  78. devtool: 'source-map',
  79. //configureWebpack: {
  80. // devtool: process.env.NODE_ENV === 'development' ? 'cheap-module-eval-source-map' : 'cheap-module-source-map',
  81. // }
  82. // configureWebpack: {
  83. // devtool: 'cheap-module-source-map',
  84. // },
  85. // Gzip off by default as many popular static hosts such as
  86. // Surge or Netlify already gzip all static assets for you.
  87. // Before setting to `true`, make sure to:
  88. // npm install --save-dev compression-webpack-plugin
  89. productionGzip: true,
  90. productionGzipExtensions: ['js', 'css'],
  91. // Run the build command with an extra argument to
  92. // View the bundle analyzer report after build finishes:
  93. // `npm run build --report`
  94. // Set to `true` or `false` to always turn it on or off
  95. bundleAnalyzerReport: process.env.npm_config_report || false,
  96. // `npm run build:prod --generate_report`
  97. generateAnalyzerReport: process.env.npm_config_generate_report || false
  98. }
  99. }