Plat Admin

index.js 2.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. 'use strict'
  2. const path = require('path')
  3. module.exports = {
  4. dev: {
  5. // Paths
  6. assetsSubDirectory: 'static',
  7. assetsPublicPath: '/',
  8. // Various Dev Server settings
  9. host: 'localhost', // can be overwritten by process.env.HOST
  10. port: 8055, // 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. // Use Eslint Loader?
  16. // If true, your code will be linted during bundling and
  17. // linting errors and warnings will be shown in the console.
  18. useEslint: true,
  19. // If true, eslint errors and warnings will also be shown in the error overlay
  20. // in the browser.
  21. showEslintErrorsInOverlay: false,
  22. /**
  23. * Source Maps
  24. */
  25. // https://webpack.js.org/configuration/devtool/#development
  26. devtool: 'source-map',
  27. // If you have problems debugging vue-files in devtools,
  28. // set this to false - it *may* help
  29. // https://vue-loader.vuejs.org/en/options.html#cachebusting
  30. cacheBusting: true,
  31. // CSS Sourcemaps off by default because relative paths are "buggy"
  32. // with this option, according to the CSS-Loader README
  33. // (https://github.com/webpack/css-loader#sourcemaps)
  34. // In our experience, they generally work as expected,
  35. // just be aware of this issue when enabling this option.
  36. cssSourceMap: false,
  37. },
  38. build: {
  39. // Template for index.html
  40. index: path.resolve(__dirname, '../dist/index.html'),
  41. // Paths
  42. assetsRoot: path.resolve(__dirname, '../dist'),
  43. assetsSubDirectory: 'static',
  44. /**
  45. * You can set by youself according to actual condition
  46. * You will need to set this if you plan to deploy your site under a sub path,
  47. * for example GitHub pages. If you plan to deploy your site to https://foo.github.io/bar/,
  48. * then assetsPublicPath should be set to "/bar/".
  49. * In most cases please use '/' !!!
  50. */
  51. assetsPublicPath: '/', // If you are deployed on the root path, please use '/'
  52. /**
  53. * Source Maps
  54. */
  55. productionSourceMap: false,
  56. // https://webpack.js.org/configuration/devtool/#production
  57. devtool: '#source-map',
  58. // Gzip off by default as many popular static hosts such as
  59. // Surge or Netlify already gzip all static assets for you.
  60. // Before setting to `true`, make sure to:
  61. // npm install --save-dev compression-webpack-plugin
  62. productionGzip: false,
  63. productionGzipExtensions: ['js', 'css'],
  64. // Run the build command with an extra argument to
  65. // View the bundle analyzer report after build finishes:
  66. // `npm run build --report`
  67. // Set to `true` or `false` to always turn it on or off
  68. bundleAnalyzerReport: process.env.npm_config_report
  69. }
  70. }