index.js 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. 'use strict'
  2. // Template version: 1.2.6
  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://127.0.0.1:8443/',
  13. changeOrigin: true,
  14. pathRewrite: {
  15. '^/api': ''
  16. }
  17. },
  18. '/file': {
  19. target: 'http://127.0.0.1:8012/',
  20. changeOrigin: true,
  21. pathRewrite: {
  22. '^/file': ''
  23. }
  24. }
  25. },
  26. // Various Dev Server settings
  27. host: '127.0.0.1', // can be overwritten by process.env.HOST
  28. port: 8090, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined
  29. autoOpenBrowser: false,
  30. errorOverlay: true,
  31. notifyOnErrors: false,
  32. poll: false, // https://webpack.js.org/configuration/dev-server/#devserver-watchoptions-
  33. // Use Eslint Loader?
  34. // If true, your code will be linted during bundling and
  35. // linting errors and warnings will be shown in the console.
  36. useEslint: true,
  37. // If true, eslint errors and warnings will also be shown in the error overlay
  38. // in the browser.
  39. showEslintErrorsInOverlay: false,
  40. /**
  41. * Source Maps
  42. */
  43. // https://webpack.js.org/configuration/devtool/#development
  44. devtool: 'cheap-source-map',
  45. // CSS Sourcemaps off by default because relative paths are "buggy"
  46. // with this option, according to the CSS-Loader README
  47. // (https://github.com/webpack/css-loader#sourcemaps)
  48. // In our experience, they generally work as expected,
  49. // just be aware of this issue when enabling this option.
  50. cssSourceMap: false
  51. },
  52. build: {
  53. // Template for index.html
  54. index: path.resolve(__dirname, '../dist/index.html'),
  55. // Paths
  56. assetsRoot: path.resolve(__dirname, '../dist'),
  57. assetsSubDirectory: 'static',
  58. /**
  59. * You can set by youself according to actual condition
  60. * You will need to set this if you plan to deploy your site under a sub path,
  61. * for example GitHub pages. If you plan to deploy your site to https://foo.github.io/bar/,
  62. * then assetsPublicPath should be set to "/bar/".
  63. * In most cases please use '/' !!!
  64. */
  65. assetsPublicPath: './',
  66. /**
  67. * Source Maps
  68. */
  69. productionSourceMap: false,
  70. // https://webpack.js.org/configuration/devtool/#production
  71. devtool: 'source-map',
  72. // Gzip off by default as many popular static hosts such as
  73. // Surge or Netlify already gzip all static assets for you.
  74. // Before setting to `true`, make sure to:
  75. // npm install --save-dev compression-webpack-plugin
  76. productionGzip: false,
  77. productionGzipExtensions: ['js', 'css'],
  78. // Run the build command with an extra argument to
  79. // View the bundle analyzer report after build finishes:
  80. // `npm run build --report`
  81. // Set to `true` or `false` to always turn it on or off
  82. bundleAnalyzerReport: process.env.npm_config_report || false,
  83. // `npm run build:prod --generate_report`
  84. generateAnalyzerReport: process.env.npm_config_generate_report || false
  85. }
  86. }