index.js 3.8 KB

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