index.js 3.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. 'use strict'
  2. // Template version: 1.3.1
  3. // see http://vuejs-templates.github.io/webpack for documentation.
  4. const path = require('path')
  5. module.exports = {
  6. dev: {
  7. // Paths
  8. assetsSubDirectory: 'static',
  9. assetsPublicPath: '/',
  10. proxyTable: {
  11. '/api/': {
  12. // target: 'http://192.168.0.104:18182/api/',
  13. target: 'https://crstest.jiinfo.cn/api/',
  14. // target: 'https://crstest.jiinfo.cn/api/',
  15. // target: 'https://bsabtestcn.jiinfo.cn/api/',
  16. // target: 'https://crs.sanyoubio.com/api/',
  17. changeOrigin: true,
  18. secure: false,
  19. pathRewrite: {
  20. '^/api/': ''
  21. }
  22. }
  23. },
  24. // Various Dev Server settings
  25. host: '127.0.0.1', // can be overwritten by process.env.HOST
  26. port: 8080, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined
  27. autoOpenBrowser: false,
  28. errorOverlay: true,
  29. notifyOnErrors: true,
  30. poll: false, // https://webpack.js.org/configuration/dev-server/#devserver-watchoptions-
  31. // Use Eslint Loader?
  32. // If true, your code will be linted during bundling and
  33. // linting errors and warnings will be shown in the console.
  34. useEslint: false,
  35. // If true, eslint errors and warnings will also be shown in the error overlay
  36. // in the browser.
  37. showEslintErrorsInOverlay: false,
  38. /**
  39. * Source Maps
  40. */
  41. // https://webpack.js.org/configuration/devtool/#development
  42. // devtool: 'cheap-module-eval-source-map',
  43. devtool: 'source-map',
  44. // If you have problems debugging vue-files in devtools,
  45. // set this to false - it *may* help
  46. // https://vue-loader.vuejs.org/en/options.html#cachebusting
  47. cacheBusting: true,
  48. cssSourceMap: true
  49. },
  50. build: {
  51. // Template for index.html
  52. index: path.resolve(__dirname, '../dist/index.html'),
  53. // Paths
  54. assetsRoot: path.resolve(__dirname, '../dist'),
  55. assetsSubDirectory: 'static',
  56. assetsPublicPath: './',
  57. productionSourceMap: false, //这个设置为false就是去掉源文件
  58. productionGzip: true, //开启gzip
  59. // https://webpack.js.org/configuration/devtool/#production
  60. devtool: '#source-map',
  61. // Gzip off by default as many popular static hosts such as
  62. // Surge or Netlify already gzip all static assets for you.
  63. // Before setting to `true`, make sure to:
  64. // npm install --save-dev compression-webpack-plugin
  65. productionGzip: false,
  66. productionGzipExtensions: ['js', 'css'],
  67. // Run the build command with an extra argument to
  68. // View the bundle analyzer report after build finishes:
  69. // `npm run build --report`
  70. // Set to `true` or `false` to always turn it on or off
  71. bundleAnalyzerReport: process.env.npm_config_report
  72. }
  73. }