vue.config.js 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. const path = require('path');
  2. module.exports = {
  3. parallel: false,
  4. productionSourceMap: false,
  5. outputDir: 'page_docs_pc',
  6. publicPath: process.env.VUE_APP_BASE_PUBLIC,
  7. lintOnSave: true,
  8. devServer: {
  9. port: '8080',
  10. disableHostCheck: true,
  11. proxy: {
  12. '^/jydocs': {
  13. target: 'https://jybx3-webtest.jydev.jianyu360.com',
  14. // target: 'http://172.17.16.53:821',
  15. // target: 'http://192.168.20.180:821',
  16. changeOrigin: true,
  17. logLevel: 'debug',
  18. pathRewrite: {
  19. '^/jydocs': '/jydocs'
  20. }
  21. },
  22. '^/publicapply': {
  23. target: 'https://jybx3-webtest.jydev.jianyu360.com',
  24. // target: 'http://172.17.16.53:821',
  25. // target: 'http://192.168.20.180:821',
  26. changeOrigin: true,
  27. logLevel: 'debug',
  28. pathRewrite: {
  29. '^/publicapply': '/publicapply'
  30. }
  31. },
  32. '^/jyintegral': {
  33. target: 'https://jybx3-webtest.jydev.jianyu360.com',
  34. // target: 'http://192.168.20.145:820',
  35. changeOrigin: true,
  36. logLevel: 'debug',
  37. pathRewrite: {
  38. '^/jyintegral': '/jyintegral'
  39. }
  40. },
  41. '^/jypay': {
  42. target: 'https://jybx3-webtest.jydev.jianyu360.com',
  43. // target: 'http://192.168.20.145:820',
  44. changeOrigin: true,
  45. logLevel: 'debug',
  46. pathRewrite: {
  47. '^/jypay': '/jypay'
  48. }
  49. }
  50. }
  51. },
  52. css: {
  53. loaderOptions: {
  54. sass: {
  55. prependData: '@import "@/assets/style/_mixin.scss";@import "@/assets/style/_variables.scss";'
  56. }
  57. }
  58. },
  59. configureWebpack: {
  60. resolve: {
  61. alias: {
  62. '@': path.resolve(__dirname, 'src/')
  63. }
  64. }
  65. },
  66. chainWebpack: config => {
  67. if (!process.env.VUE_APP_ALONE) {
  68. config.devServer.set('inline', false)
  69. config.devServer.set('hot', true)
  70. if (process.env.NODE_ENV !== 'production') {
  71. config.output.filename('js/[name].js')
  72. }
  73. config.externals(['vue', 'vue-router'])
  74. }
  75. },
  76. filenameHashing: false
  77. }