vue.config.js 1.5 KB

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