Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.
 
 
 
 

99 rindas
3.0 KiB

  1. /*
  2. * @Author: zwq
  3. * @Date: 2021-10-13 10:27:21
  4. * @LastEditors: zwq
  5. * @LastEditTime: 2021-10-14 14:22:45
  6. * @Description:
  7. */
  8. 'use strict'
  9. // Template version: 1.2.5
  10. // see http://vuejs-templates.github.io/webpack for documentation.
  11. const path = require('path')
  12. const devEnv = require('./dev.env')
  13. module.exports = {
  14. dev: {
  15. // Paths
  16. assetsSubDirectory: 'static',
  17. assetsPublicPath: '/',
  18. // 代理列表, 是否开启代理通过[./dev.env.js]配置
  19. proxyTable: devEnv.OPEN_PROXY === false ? {} : {
  20. '/proxyApi': {
  21. target: 'http://demo.renren.io/renren-fast/',
  22. changeOrigin: true,
  23. pathRewrite: {
  24. '^/proxyApi': '/'
  25. }
  26. }
  27. },
  28. // Various Dev Server settings
  29. host: '0.0.0.0', // can be overwritten by process.env.HOST
  30. port: 8001, // 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.
  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. }