nuxt.config.js 2.4 KB

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