index.js 3.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  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. "/liveapi": {
  12. target: "https://live.shangxueshe.cn/liveapi", //设置你调用的接口域名和端口号 别忘了加http、https
  13. changeOrigin: true, //是否跨域
  14. // secure: true, // 允许https请求
  15. pathRewrite: {
  16. "^/liveapi": "" //这里理解成用‘/api’代替target里面的地址
  17. }
  18. },
  19. "/live": {
  20. target: "https://live.shangxueshe.cn/live", //设置你调用的接口域名和端口号 别忘了加http、https
  21. changeOrigin: true, //是否跨域
  22. // secure: true, // 允许https请求
  23. pathRewrite: {
  24. "^/live": "" //这里理解成用‘/api’代替target里面的地址
  25. }
  26. }
  27. },
  28. // Various Dev Server settings
  29. host: 'localhost', // can be overwritten by process.env.HOST
  30. port: 8080, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined
  31. autoOpenBrowser: false,
  32. errorOverlay: true,
  33. notifyOnErrors: true,
  34. poll: false, // https://webpack.js.org/configuration/dev-server/#devserver-watchoptions-
  35. /**
  36. * Source Maps
  37. */
  38. // https://webpack.js.org/configuration/devtool/#development
  39. devtool: 'cheap-module-eval-source-map',
  40. // If you have problems debugging vue-files in devtools,
  41. // set this to false - it *may* help
  42. // https://vue-loader.vuejs.org/en/options.html#cachebusting
  43. cacheBusting: true,
  44. cssSourceMap: true
  45. },
  46. build: {
  47. // Template for index.html
  48. index: path.resolve(__dirname, "../../../app/sys/view/broad/dashboard.html"),
  49. // Paths
  50. //assetsRoot: path.resolve(__dirname, "../dist"),
  51. assetsRoot: path.resolve(__dirname, "../../../public/"),
  52. assetsSubDirectory: 'dashboard1',
  53. assetsPublicPath: '/',
  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 --report`
  69. // Set to `true` or `false` to always turn it on or off
  70. bundleAnalyzerReport: process.env.npm_config_report
  71. }
  72. }