nuxt.config.js 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. module.exports = {
  2. // modules: ['@nuxtjs/axios', "@nuxtjs/proxy"],
  3. // /*
  4. // ** axios proxy
  5. // */
  6. // axios: {
  7. // proxy: true
  8. // },
  9. // /*
  10. // ** proxy
  11. // */
  12. // proxy: {
  13. // // 一旦devServer(5000)服务器接收到 /api/xxx 的请求,就会把请求转发到另一个服务器(3000)
  14. // // 浏览器和服务器之间有跨域,但是服务器和服务器之间没有跨域
  15. // '/api/': {
  16. // target: 'http://192.168.122.10:31821',
  17. // // 发送请求时,请求路径重写:将 /api/xxx --> /xxx (去掉/api)
  18. // // pathRewrite: {
  19. // // '^/api/': ''
  20. // // }
  21. // }
  22. // },
  23. /*
  24. ** Headers of the page
  25. */
  26. head: {
  27. title: 'yygh-site',
  28. meta: [
  29. { charset: 'utf-8' },
  30. { name: 'viewport', content: 'width=device-width, initial-scale=1' },
  31. { hid: 'description', name: 'description', content: '尚医通 - 预约挂号统一平台' }
  32. ],
  33. link: [
  34. { rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' }
  35. ]
  36. },
  37. /*
  38. ** Customize the progress bar color
  39. */
  40. loading: { color: '#3B8070' },
  41. plugins: [{
  42. src: '~plugins/myPlugin',
  43. ssr: true,
  44. }],
  45. css: [
  46. 'element-ui/lib/theme-chalk/index.css'
  47. ],
  48. /*
  49. ** Build configuration
  50. */
  51. build: {
  52. vendor: ['axios'],
  53. /*
  54. ** Run ESLint on save
  55. */
  56. extend (config, { isDev, isClient }) {
  57. if (isDev && isClient) {
  58. config.module.rules.push({
  59. enforce: 'pre',
  60. test: /\.(js|vue)$/,
  61. loader: 'eslint-loader',
  62. exclude: /(node_modules)/
  63. })
  64. }
  65. }
  66. }
  67. }