index.js 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. /*
  2. * @Author: ZhengXiaowei
  3. * @Date: 2019-04-12 14:35:42
  4. * LastEditors: 晓晓晓晓晓丶vv
  5. * LastEditTime: 2020-08-21 15:26:55
  6. * @Description: file content
  7. */
  8. "use strict";
  9. // Template version: 1.2.8
  10. // see http://vuejs-templates.github.io/webpack for documentation.
  11. const path = require("path");
  12. // "https://siteywmkx29emyevn514.leyuee.com/
  13. module.exports = {
  14. dev: {
  15. // Paths
  16. assetsSubDirectory: "static",
  17. assetsPublicPath: "/",
  18. proxyTable: {
  19. "/api": {
  20. // target: "http://site2.pre.aizhuishu.com/",
  21. target: "https://site14.leyuee.com",
  22. changeOrigin: true
  23. },
  24. "/testLogin": {
  25. // target: "http://site2.pre.aizhuishu.com/",
  26. target: "https://site14.leyuee.com",
  27. changeOrigin: true
  28. }
  29. },
  30. // Various Dev Server settings
  31. host: "localhost", // can be overwritten by process.env.HOST
  32. port: 8080, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined
  33. autoOpenBrowser: false,
  34. errorOverlay: true,
  35. notifyOnErrors: true,
  36. poll: false, // https://webpack.js.org/configuration/dev-server/#devserver-watchoptions-
  37. /**
  38. * Source Maps
  39. */
  40. // https://webpack.js.org/configuration/devtool/#development
  41. // devtool: "cheap-module-eval-source-map",
  42. devtool: "cheap-module-eval-source-map",
  43. // If you have problems debugging vue-files in devtools,
  44. // set this to false - it *may* help
  45. // https://vue-loader.vuejs.org/en/options.html#cachebusting
  46. cacheBusting: true,
  47. // CSS Sourcemaps off by default because relative paths are "buggy"
  48. // with this option, according to the CSS-Loader README
  49. // (https://github.com/webpack/css-loader#sourcemaps)
  50. // In our experience, they generally work as expected,
  51. // just be aware of this issue when enabling this option.
  52. cssSourceMap: false,
  53. disableHostCheck: true
  54. },
  55. build: {
  56. // Template for index.html
  57. index: path.resolve(__dirname, "../dist/index.html"),
  58. // Paths
  59. assetsRoot: path.resolve(__dirname, "../dist"),
  60. assetsSubDirectory:
  61. "static" + new Date().toLocaleDateString().replace(/\//g, "-"),
  62. assetsPublicPath: "https://cdn-novel.bookkks.com/",
  63. /**
  64. * Source Maps
  65. */
  66. productionSourceMap: true,
  67. // https://webpack.js.org/configuration/devtool/#production
  68. devtool: "#source-map",
  69. // Gzip off by default as many popular static hosts such as
  70. // Surge or Netlify already gzip all static assets for you.
  71. // Before setting to `true`, make sure to:
  72. // npm install --save-dev compression-webpack-plugin
  73. productionGzip: false,
  74. productionGzipExtensions: ["js", "css"],
  75. // Run the build command with an extra argument to
  76. // View the bundle analyzer report after build finishes:
  77. // `npm run build --report`
  78. // Set to `true` or `false` to always turn it on or off
  79. bundleAnalyzerReport: process.env.npm_config_report
  80. }
  81. };