index.js 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. 'use strict'
  2. const path = require('path')
  3. module.exports = {
  4. dev: {
  5. // Paths
  6. assetsSubDirectory: 'static',
  7. assetsPublicPath: '',
  8. proxyTable: {},
  9. host: 'localhost',
  10. port: 9528, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined
  11. autoOpenBrowser: false,
  12. errorOverlay: true,
  13. notifyOnErrors: false,
  14. poll: false, // https://webpack.js.org/configuration/dev-server/#devserver-watchoptions-
  15. useEslint: false,
  16. showEslintErrorsInOverlay: false,
  17. devtool: 'cheap-source-map',
  18. cssSourceMap: false
  19. },
  20. build: {
  21. // Template for index.html
  22. index: path.resolve(__dirname, '../dist/index.html'),
  23. // Paths
  24. assetsRoot: path.resolve(__dirname, '../dist'),
  25. assetsSubDirectory: 'static',
  26. /**
  27. * You can set by youself according to actual condition
  28. * You will need to set this if you plan to deploy your site under a sub path,
  29. * for example GitHub pages. If you plan to deploy your site to https://foo.github.io/bar/,
  30. * then assetsPublicPath should be set to "/bar/".
  31. * In most cases please use '/' !!!
  32. */
  33. assetsPublicPath: '', // If you are deployed on the root path, please use '/'
  34. /**
  35. * Source Maps
  36. */
  37. productionSourceMap: false,
  38. // https://webpack.js.org/configuration/devtool/#production
  39. devtool: 'source-map',
  40. // Gzip off by default as many popular static hosts such as
  41. // Surge or Netlify already gzip all static assets for you.
  42. // Before setting to `true`, make sure to:
  43. // npm install --save-dev compression-webpack-plugin
  44. productionGzip: true,
  45. productionGzipExtensions: ['js', 'css'],
  46. // Run the build command with an extra argument to
  47. // View the bundle analyzer report after build finishes:
  48. // `npm run build:prod --report`
  49. // Set to `true` or `false` to always turn it on or off
  50. bundleAnalyzerReport: process.env.npm_config_report || false,
  51. // `npm run build:prod --generate_report`
  52. generateAnalyzerReport: process.env.npm_config_generate_report || false
  53. }
  54. }