index.js 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  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. /**
  7. * 分销功能开关
  8. * 如果您需要开启分销相关功能,请设置为true
  9. */
  10. distribution: true,
  11. dev: {
  12. // Paths
  13. assetsSubDirectory: 'static',
  14. assetsPublicPath: '/',
  15. proxyTable: {},
  16. // Various Dev Server settings
  17. host: '0.0.0.0', // can be overwritten by process.env.HOST
  18. port: 3003, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined
  19. autoOpenBrowser: false,
  20. errorOverlay: true,
  21. notifyOnErrors: false,
  22. poll: false, // https://webpack.js.org/configuration/dev-server/#devserver-watchoptions-
  23. // Use Eslint Loader?
  24. // If true, your code will be linted during bundling and
  25. // linting errors and warnings will be shown in the console.
  26. useEslint: true,
  27. // If true, eslint errors and warnings will also be shown in the error overlay
  28. // in the browser.
  29. showEslintErrorsInOverlay: false,
  30. /**
  31. * Source Maps
  32. */
  33. // https://webpack.js.org/configuration/devtool/#development
  34. devtool: '#cheap-source-map',
  35. // If you have problems debugging vue-files in devtools,
  36. // set this to false - it *may* help
  37. // https://vue-loader.vuejs.org/en/options.html#cachebusting
  38. cacheBusting: true,
  39. // CSS Sourcemaps off by default because relative paths are "buggy"
  40. // with this option, according to the CSS-Loader README
  41. // (https://github.com/webpack/css-loader#sourcemaps)
  42. // In our experience, they generally work as expected,
  43. // just be aware of this issue when enabling this option.
  44. cssSourceMap: false,
  45. },
  46. build: {
  47. // Template for index.html
  48. index: path.resolve(__dirname, '../dist/index.html'),
  49. // Paths
  50. assetsRoot: path.resolve(__dirname, '../dist'),
  51. assetsSubDirectory: 'static',
  52. // you can set by youself according to actual condition
  53. assetsPublicPath: '/',
  54. /**
  55. * Source Maps
  56. */
  57. productionSourceMap: false,
  58. // https://webpack.js.org/configuration/devtool/#production
  59. devtool: '#source-map',
  60. // Gzip off by default as many popular static hosts such as
  61. // Surge or Netlify already gzip all static assets for you.
  62. // Before setting to `true`, make sure to:
  63. // npm install --save-dev compression-webpack-plugin
  64. productionGzip: true,
  65. productionGzipExtensions: ['js', 'css'],
  66. // Run the build command with an extra argument to
  67. // View the bundle analyzer report after build finishes:
  68. // `npm run build --report`
  69. // Set to `true` or `false` to always turn it on or off
  70. bundleAnalyzerReport: process.env.npm_config_report
  71. }
  72. }