nuxt.config.js 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204
  1. /********** 本地环境 start **********/
  2. const dev = {
  3. baseURL: 'http://192.168.0.179:82/api',
  4. host: 'localhost',
  5. }
  6. const pro = {
  7. baseURL: 'http://182.92.186.22:83/api',
  8. host: 'http://182.92.186.22:83/api',
  9. }
  10. const isDev = true;
  11. export default {
  12. /*
  13. ** Nuxt rendering mode
  14. ** See https://nuxtjs.org/api/configuration-mode
  15. */
  16. mode: 'universal',
  17. /*
  18. ** Nuxt target
  19. ** See https://nuxtjs.org/api/configuration-target
  20. */
  21. target: 'server',
  22. /*
  23. ** Headers of the page
  24. ** See https://nuxtjs.org/api/configuration-head
  25. */
  26. head: {
  27. title: process.env.npm_package_name || '',
  28. meta: [
  29. { charset: 'utf-8' },
  30. // { name: 'viewport', content: 'width=device-width, initial-scale=1' },
  31. // 移动端视口
  32. { name: 'viewport', content: 'width=device-width, user-csalable=yes, initial-scale=0.25, minimum-scale=0.1, maximum-scale=0.25' },
  33. { name: 'nuxtConfigDescription', content: process.env.npm_package_description || '' },
  34. {name:'applicable-device',content:'pc'},
  35. { 'http-equiv':"Cache-Control",content:'no-transform' },
  36. { 'http-equiv':"Cache-Control",content:'no-siteapp' },
  37. ],
  38. link: [
  39. { rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' },
  40. ],
  41. },
  42. /*
  43. ** Global CSS
  44. */
  45. css: [
  46. 'element-ui/lib/theme-chalk/index.css',
  47. // 移动端栅格
  48. // 'element-ui/lib/theme-chalk/display.css',
  49. '@/assets/scss/main.scss'
  50. ],
  51. /*
  52. ** Plugins to load before mounting the App
  53. ** https://nuxtjs.org/guide/plugins
  54. */
  55. plugins: [
  56. '@/plugins/element-ui', '~/plugins/axios.http', {src:'~plugins/loadsh.js',ssr: false},{src:'~plugins/consult.js',ssr: false},
  57. ],
  58. /*
  59. ** Auto import components
  60. ** See https://nuxtjs.org/api/configuration-components
  61. */
  62. components: true,
  63. /*
  64. ** Nuxt.js dev-modules
  65. */
  66. buildModules: [],
  67. /**
  68. * 环境变量设置 新闻 拼路径时的根级别路径 多用于a标签 href属性
  69. */
  70. env: {
  71. baseUrl: 'http://localhost:3000'
  72. },
  73. /**
  74. * loading 进度条样式
  75. */
  76. loading: false,
  77. /*
  78. ** Nuxt.js modules
  79. */
  80. modules: ['@nuxtjs/axios'],
  81. /*
  82. ** Build configuration
  83. ** See https://nuxtjs.org/api/configuration-build/
  84. */
  85. build: {
  86. transpile: [/^element-ui/],
  87. // 异步加载样式 默认false
  88. extractCSS: true
  89. },
  90. axios: {
  91. // node连接服务器地址(调用后台接口地址)
  92. // baseURL: 'http://182.92.186.22:83/api',
  93. baseURL: 'http://192.168.0.179:8100',
  94. },
  95. };
  96. /********** 本地环境 end **********/
  97. /********** 正式环境打包 start **********/
  98. /*const dev = {
  99. baseURL: 'http://192.168.0.179:82/api',
  100. host: 'localhost',
  101. }
  102. const pro = {
  103. baseURL: 'https://www.mtavip.com/api',
  104. host: 'https://www.mtavip.com/api',
  105. }
  106. const isDev = true;
  107. export default {
  108. /!*
  109. ** Nuxt rendering mode
  110. ** See https://nuxtjs.org/api/configuration-mode
  111. *!/
  112. mode: 'universal',
  113. /!*
  114. ** Nuxt target
  115. ** See https://nuxtjs.org/api/configuration-target
  116. *!/
  117. target: 'server',
  118. /!*
  119. ** Headers of the page
  120. ** See https://nuxtjs.org/api/configuration-head
  121. *!/
  122. head: {
  123. title: process.env.npm_package_name || '',
  124. meta: [
  125. { charset: 'utf-8' },
  126. // { name: 'viewport', content: 'width=device-width, initial-scale=1' },
  127. // 移动端视口
  128. { name: 'viewport', content: 'width=device-width, user-csalable=yes, initial-scale=0.25, minimum-scale=0.1, maximum-scale=0.25' },
  129. { name: 'nuxtConfigDescription', content: process.env.npm_package_description || '' },
  130. {name:'applicable-device',content:'pc'},
  131. { 'http-equiv':"Cache-Control",content:'no-transform' },
  132. { 'http-equiv':"Cache-Control",content:'no-siteapp' },
  133. ],
  134. link: [
  135. { rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' },
  136. ],
  137. },
  138. /!*
  139. ** Global CSS
  140. *!/
  141. css: [
  142. 'element-ui/lib/theme-chalk/index.css',
  143. // 移动端栅格
  144. 'element-ui/lib/theme-chalk/display.css',
  145. '@/assets/scss/main.scss'
  146. ],
  147. /!*
  148. ** Plugins to load before mounting the App
  149. ** https://nuxtjs.org/guide/plugins
  150. *!/
  151. plugins: [
  152. '@/plugins/element-ui', '~/plugins/axios.http', {src:'~plugins/loadsh.js',ssr: false},{src:'~plugins/consult.js',ssr: false},
  153. ],
  154. /!*
  155. ** Auto import components
  156. ** See https://nuxtjs.org/api/configuration-components
  157. *!/
  158. components: true,
  159. /!*
  160. ** Nuxt.js dev-modules
  161. *!/
  162. buildModules: [],
  163. /!**
  164. * 环境变量设置 新闻 拼路径时的根级别路径 多用于a标签 href属性
  165. *!/
  166. env: {
  167. baseUrl: 'https://www.mtavip.com'
  168. },
  169. /!**
  170. * loading 进度条样式
  171. *!/
  172. loading: false,
  173. /!*
  174. ** Nuxt.js modules
  175. *!/
  176. modules: ['@nuxtjs/axios'],
  177. /!*
  178. ** Build configuration
  179. ** See https://nuxtjs.org/api/configuration-build/
  180. *!/
  181. build: {
  182. transpile: [/^element-ui/],
  183. // 异步加载样式 默认false
  184. extractCSS: true
  185. },
  186. server: {
  187. // port 端口,默认3000,nuxt默认
  188. port: 3000, // default: 3000
  189. // host:连接服务器主机名
  190. host: '192.168.0.79' // default: localhost,
  191. },
  192. axios: {
  193. // 正式环境
  194. baseURL: 'https://www.mtavip.com/api',
  195. },
  196. };*/
  197. /********** 正式环境打包 end **********/