index.js 3.0 KB

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