nuxt.config.js 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. import settings from './settings'
  2. export default {
  3. ssr: false,
  4. server: {
  5. port: settings.port, // default: 3000
  6. // host: '192.168.3.14' // default: localhost
  7. // host:"localhost",
  8. host:settings.host,
  9. },
  10. // disableHostCheck: true,
  11. modules: [
  12. '@nuxtjs/axios',
  13. '@nuxtjs/proxy'
  14. ],
  15. axios: {
  16. prefix:settings.prefix,
  17. proxy: true
  18. },
  19. proxy: {
  20. '/demo': {
  21. target: 'https://www.huijy.net/',
  22. pathRewrite: {
  23. '^/demo' : '/demo'
  24. }
  25. }
  26. },
  27. head: {
  28. title: '智慧易加',
  29. meta: [{
  30. charset: 'utf-8'
  31. },
  32. {
  33. name: 'viewport',
  34. content: 'width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no'
  35. }
  36. ],
  37. link: [{
  38. rel: 'icon',
  39. type: 'image/x-icon',
  40. href: '/favicon.ico'
  41. }]
  42. },
  43. plugins: [
  44. '~/plugins/vant',
  45. '~/plugins/vue-map'
  46. ],
  47. build: {
  48. babel: {
  49. plugins: [
  50. [
  51. 'import',
  52. {
  53. libraryName: 'vant',
  54. // 目前在 nuxt 中无法按需引入样式,因此采用手动引入的方式
  55. style: false
  56. },
  57. 'vant'
  58. ]
  59. ]
  60. }
  61. },
  62. css:[
  63. "~assets/css/common.css"
  64. ]
  65. };