nuxt.config.js 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. const dev = {
  2. baseURL: 'http://192.168.0.179:82/api',
  3. host: 'localhost',
  4. }
  5. const pro = {
  6. baseURL: 'http://182.92.186.22:83/api',
  7. host: 'http://182.92.186.22:83/api',
  8. }
  9. const isDev = true;
  10. export default {
  11. /*
  12. ** Nuxt rendering mode
  13. ** See https://nuxtjs.org/api/configuration-mode
  14. */
  15. mode: 'universal',
  16. /*
  17. ** Nuxt target
  18. ** See https://nuxtjs.org/api/configuration-target
  19. */
  20. target: 'server',
  21. /*
  22. ** Headers of the page
  23. ** See https://nuxtjs.org/api/configuration-head
  24. */
  25. head: {
  26. title: process.env.npm_package_name || '',
  27. meta: [
  28. { charset: 'utf-8' },
  29. { name: 'viewport', content: 'width=device-width, initial-scale=1' },
  30. // { name: 'viewport', content: 'width=device-width, user-csalable=yes, initial-scale=0.25, minimum-scale=0.1, maximum-scale=0.25' },
  31. { name: 'nuxtConfigDescription', content: process.env.npm_package_description || '' },
  32. {name:'applicable-device',content:'pc'},
  33. { 'http-equiv':"Cache-Control",content:'no-transform' },
  34. { 'http-equiv':"Cache-Control",content:'no-siteapp' },
  35. ],
  36. link: [
  37. { rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' },
  38. ],
  39. },
  40. /*
  41. ** Global CSS
  42. */
  43. css: [
  44. 'element-ui/lib/theme-chalk/index.css',
  45. '@/assets/scss/main.scss'
  46. ],
  47. /*
  48. ** Plugins to load before mounting the App
  49. ** https://nuxtjs.org/guide/plugins
  50. */
  51. plugins: [
  52. '@/plugins/element-ui', '~/plugins/axios.http', {src:'~plugins/loadsh.js',ssr: false},{src:'~plugins/consult.js',ssr: false},
  53. ],
  54. /*
  55. ** Auto import components
  56. ** See https://nuxtjs.org/api/configuration-components
  57. */
  58. components: true,
  59. /*
  60. ** Nuxt.js dev-modules
  61. */
  62. buildModules: [],
  63. /**
  64. * 环境变量设置 新闻 拼路径时的根级别路径 多用于a标签 href属性
  65. */
  66. env: {
  67. baseUrl: 'http://localhost:3000'
  68. },
  69. /**
  70. * loading 进度条样式
  71. */
  72. loading: false,
  73. /*
  74. ** Nuxt.js modules
  75. */
  76. modules: ['@nuxtjs/axios'],
  77. /*
  78. ** Build configuration
  79. ** See https://nuxtjs.org/api/configuration-build/
  80. */
  81. build: {
  82. transpile: [/^element-ui/],
  83. // 异步加载样式 默认false
  84. extractCSS: true
  85. },
  86. // server: {
  87. // port 端口,默认3000,nuxt默认
  88. // port: 3000, // default: 3000
  89. // host:连接服务器主机名
  90. // host: '192.168.0.79' // default: localhost,
  91. // },
  92. axios: {
  93. // node连接服务器地址(调用后台接口地址)
  94. // baseURL: 'http://182.92.186.22:83/api',
  95. baseURL: 'http://192.168.0.179:8100',
  96. },
  97. };