index.js 2.9 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. const webpack = require('webpack')
  6. module.exports = {
  7. dev: {
  8. // Paths
  9. assetsSubDirectory: 'static',
  10. assetsPublicPath: '/',
  11. proxyTable: {},
  12. // Various Dev Server settings
  13. // can be overwritten by process.env.HOST
  14. // if you want dev by ip, please set host: '0.0.0.0'
  15. host: 'localhost',
  16. port: 8080, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined
  17. autoOpenBrowser: false,
  18. errorOverlay: true,
  19. notifyOnErrors: false,
  20. poll: false, // https://webpack.js.org/configuration/dev-server/#devserver-watchoptions-
  21. // Use Eslint Loader?
  22. // If true, your code will be linted during bundling and
  23. // linting errors and warnings will be shown in the console.
  24. useEslint: true,
  25. // If true, eslint errors and warnings will also be shown in the error overlay
  26. // in the browser.
  27. showEslintErrorsInOverlay: false,
  28. /**
  29. * Source Maps
  30. */
  31. // https://webpack.js.org/configuration/devtool/#development
  32. devtool: 'cheap-source-map',
  33. // CSS Sourcemaps off by default because relative paths are "buggy"
  34. // with this option, according to the CSS-Loader README
  35. // (https://github.com/webpack/css-loader#sourcemaps)
  36. // In our experience, they generally work as expected,
  37. // just be aware of this issue when enabling this option.
  38. cssSourceMap: false
  39. },
  40. build: {
  41. // Template for index.html
  42. index: path.resolve(__dirname, '../dist/index.html'),
  43. // Paths
  44. assetsRoot: path.resolve(__dirname, '../dist'),
  45. assetsSubDirectory: 'static',
  46. /**
  47. * You can set by youself according to actual condition
  48. * You will need to set this if you plan to deploy your site under a sub path,
  49. * for example GitHub pages. If you plan to deploy your site to https://foo.github.io/bar/,
  50. * then assetsPublicPath should be set to "/bar/".
  51. * In most cases please use '/' !!!
  52. */
  53. assetsPublicPath: '/datamap/',
  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: false,
  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:prod --report`
  69. // Set to `true` or `false` to always turn it on or off
  70. bundleAnalyzerReport: process.env.npm_config_report || false,
  71. // `npm run build:prod --generate_report`
  72. generateAnalyzerReport: process.env.npm_config_generate_report || false
  73. }
  74. }