index.js 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  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. module.exports = {
  6. dev: {
  7. // Paths
  8. assetsSubDirectory: 'static',
  9. assetsPublicPath: '/',
  10. proxyTable: {
  11. // '/api': {
  12. // target: 'http://192.168.1.8:8000/',
  13. // target: 'http://192.168.1.123:8007/',
  14. // target: 'http://192.168.1.4:8000/',//杨
  15. // changeOrigin: true,
  16. // pathRewrite: {
  17. // '^/api': '' //重写接口
  18. // }
  19. // },
  20. '/': {
  21. // // target: 'http://192.168.1.8:8000/',
  22. target: 'http://192.168.1.66:9000/',
  23. // target: 'http://192.168.1.4:8000/',//杨
  24. changeOrigin: true,
  25. pathRewrite: {
  26. '': '' //重写接口
  27. }
  28. },
  29. },
  30. // Various Dev Server settings
  31. host: '192.168.1.66', // can be overwritten by process.env.HOST
  32. port: 8000, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined
  33. autoOpenBrowser: false,
  34. errorOverlay: true,
  35. notifyOnErrors: true,
  36. poll: false, // https://webpack.js.org/configuration/dev-server/#devserver-watchoptions-
  37. // Use Eslint Loader?
  38. // If true, your code will be linted during bundling and
  39. // linting errors and warnings will be shown in the console.
  40. useEslint: true,
  41. // If true, eslint errors and warnings will also be shown in the error overlay
  42. // in the browser.
  43. showEslintErrorsInOverlay: false,
  44. /**
  45. * Source Maps
  46. */
  47. // https://webpack.js.org/configuration/devtool/#development
  48. devtool: 'cheap-module-eval-source-map',
  49. // If you have problems debugging vue-files in devtools,
  50. // set this to false - it *may* help
  51. // https://vue-loader.vuejs.org/en/options.html#cachebusting
  52. cacheBusting: true,
  53. cssSourceMap: true
  54. },
  55. build: {
  56. // Template for index.html
  57. index: path.resolve(__dirname, '../dist/index.html'),
  58. // Paths
  59. assetsRoot: path.resolve(__dirname, '../dist'),
  60. assetsSubDirectory: 'static',
  61. assetsPublicPath: '/',
  62. /**
  63. * Source Maps
  64. */
  65. productionSourceMap: false,
  66. // https://webpack.js.org/configuration/devtool/#production
  67. devtool: '#source-map',
  68. // Gzip off by default as many popular static hosts such as
  69. // Surge or Netlify already gzip all static assets for you.
  70. // Before setting to `true`, make sure to:
  71. // npm install --save-dev compression-webpack-plugin
  72. productionGzip: false,
  73. productionGzipExtensions: ['js', 'css'],
  74. // Run the build command with an extra argument to
  75. // View the bundle analyzer report after build finishes:
  76. // `npm run build --report`
  77. // Set to `true` or `false` to always turn it on or off
  78. bundleAnalyzerReport: process.env.npm_config_report
  79. }
  80. }