index.js 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. 'use strict'
  2. // Template version: 1.2.7
  3. // see http://vuejs-templates.github.io/webpack for documentation.
  4. const path = require('path')
  5. // import common from '../src/assets/js/common.js';
  6. module.exports = {
  7. dev: {
  8. // Paths
  9. assetsSubDirectory: 'static',
  10. assetsPublicPath: '/',
  11. proxyTable: {
  12. // '/api':{
  13. // target:'http://192.168.1.79:8080',//common.ctx,//
  14. // changeOrigin:true,
  15. // pathRewrite:{
  16. // '^/api':''
  17. // }
  18. // },
  19. // '/ms':{
  20. // target:'http://192.168.1.79:8081',//common.ctxForm,//
  21. // changeOrigin:true,
  22. // pathRewrite:{
  23. // '^/ms':''
  24. // }
  25. // }
  26. },
  27. // Various Dev Server settings
  28. host: 'localhost', // can be overwritten by process.env.HOST
  29. port: 8081, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined
  30. autoOpenBrowser: false,
  31. errorOverlay: true,
  32. notifyOnErrors: true,
  33. poll: false, // https://webpack.js.org/configuration/dev-server/#devserver-watchoptions-
  34. /**
  35. * Source Maps
  36. */
  37. // https://webpack.js.org/configuration/devtool/#development
  38. devtool: 'eval-source-map',
  39. // If you have problems debugging vue-files in devtools,
  40. // set this to false - it *may* help
  41. // https://vue-loader.vuejs.org/en/options.html#cachebusting
  42. cacheBusting: true,
  43. // CSS Sourcemaps off by default because relative paths are "buggy"
  44. // with this option, according to the CSS-Loader README
  45. // (https://github.com/webpack/css-loader#sourcemaps)
  46. // In our experience, they generally work as expected,
  47. // just be aware of this issue when enabling this option.
  48. cssSourceMap: false,
  49. },
  50. build: {
  51. // Template for index.html
  52. index: path.resolve(__dirname, '../dist/index.html'),
  53. // Paths
  54. assetsRoot: path.resolve(__dirname, '../dist'),
  55. assetsSubDirectory: 'static',
  56. assetsPublicPath: './',
  57. /**
  58. * Source Maps
  59. */
  60. productionSourceMap: false,
  61. // https://webpack.js.org/configuration/devtool/#production
  62. devtool: '#source-map',
  63. // Gzip off by default as many popular static hosts such as
  64. // Surge or Netlify already gzip all static assets for you.
  65. // Before setting to `true`, make sure to:
  66. // npm install --save-dev compression-webpack-plugin
  67. productionGzip: false,
  68. productionGzipExtensions: ['js', 'css'],
  69. // Run the build command with an extra argument to
  70. // View the bundle analyzer report after build finishes:
  71. // `npm run build --report`
  72. // Set to `true` or `false` to always turn it on or off
  73. bundleAnalyzerReport: process.env.npm_config_report,
  74. }
  75. }