nuxt.config.js 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  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: 'nuxtConfigDescription', content: process.env.npm_package_description || '' },
  31. {name:'applicable-device',content:'pc'},
  32. { 'http-equiv':"Cache-Control",content:'no-transform' },
  33. { 'http-equiv':"Cache-Control",content:'no-siteapp' },
  34. ],
  35. link: [
  36. { rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' },
  37. ],
  38. },
  39. /*
  40. ** Global CSS
  41. */
  42. css: [
  43. 'element-ui/lib/theme-chalk/index.css',
  44. '@/assets/scss/main.scss'
  45. ],
  46. /*
  47. ** Plugins to load before mounting the App
  48. ** https://nuxtjs.org/guide/plugins
  49. */
  50. plugins: [
  51. '@/plugins/element-ui', '~/plugins/axios.http', {src:'~plugins/loadsh.js',ssr: false},
  52. ],
  53. /*
  54. ** Auto import components
  55. ** See https://nuxtjs.org/api/configuration-components
  56. */
  57. components: true,
  58. /*
  59. ** Nuxt.js dev-modules
  60. */
  61. buildModules: [],
  62. /**
  63. * 环境变量设置 新闻 拼路径时的根级别路径 多用于a标签 href属性
  64. */
  65. env: {
  66. baseUrl: 'http://localhost:3000'
  67. },
  68. /**
  69. * loading 进度条样式
  70. */
  71. loading: false,
  72. /*
  73. ** Nuxt.js modules
  74. */
  75. modules: ['@nuxtjs/axios'],
  76. /*
  77. ** Build configuration
  78. ** See https://nuxtjs.org/api/configuration-build/
  79. */
  80. build: {
  81. transpile: [/^element-ui/],
  82. // 异步加载样式 默认false
  83. extractCSS: true
  84. },
  85. // server: {
  86. // port: 3000, // default: 3000
  87. // host: '192.168.0.79' // default: localhost,
  88. // },
  89. // server: {
  90. // port: 3000, // default: 3000
  91. // host: '192.168.0.179' // default: localhost,
  92. // },
  93. // server: {
  94. // port: 3000, // default: 3000
  95. // host: isDev ? dev.host : pro.host // default: localhost,
  96. // },
  97. axios: {
  98. // baseURL: isDev ? dev.baseURL : pro.baseURL
  99. // baseURL: 'http://182.92.186.22:83/api',
  100. baseURL: 'http://192.168.0.179:8100',
  101. // baseURL: 'http://182.92.186.22:83/api', // Used as fallback if no runtime config is provided
  102. },
  103. };