nuxt.config.js 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. export default {
  2. // Target: https://go.nuxtjs.dev/config-target
  3. target: 'server',
  4. server:{
  5. port: 3001,
  6. },
  7. env: {
  8. BASE_URL: process.env.BASE_URL,
  9. NODE_ENV: process.env.NODE_ENV
  10. },
  11. // Global page headers: https://go.nuxtjs.dev/config-head
  12. head: {
  13. title: 'gs_nuxt',
  14. htmlAttrs: {
  15. lang: 'en',
  16. },
  17. meta: [
  18. { charset: 'utf-8' },
  19. { name: 'viewport', content: 'width=device-width, initial-scale=1' },
  20. { hid: 'description', name: 'description', content: '' },
  21. { name: 'format-detection', content: 'telephone=no' },
  22. ],
  23. link: [{ rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' }],
  24. },
  25. // Global CSS: https://go.nuxtjs.dev/config-css
  26. css: ['element-ui/lib/theme-chalk/index.css'],
  27. // Plugins to run before rendering page: https://go.nuxtjs.dev/config-plugins
  28. plugins: [{src:'@/plugins/element-ui'},{src:'@/plugins/echarts.js'}],
  29. // Auto import components: https://go.nuxtjs.dev/config-components
  30. components: true,
  31. // Modules for dev and build (recommended): https://go.nuxtjs.dev/config-modules
  32. buildModules: [
  33. // https://go.nuxtjs.dev/eslint
  34. // '@nuxtjs/eslint-module',
  35. // https://go.nuxtjs.dev/stylelint
  36. // '@nuxtjs/stylelint-module',
  37. ],
  38. // Modules: https://go.nuxtjs.dev/config-modules
  39. modules: [
  40. '@nuxtjs/axios',
  41. '@nuxtjs/proxy'
  42. ],
  43. axios: {
  44. proxy: true // Can be also an object with default options
  45. },
  46. // proxy: {
  47. // '/api': {
  48. // changeOrigin: true,
  49. // target: 'http://localhost:8090/website/', // 允许跨域的服务器地址
  50. // pathRewrite: {
  51. // '^/api': ''
  52. // }
  53. // }
  54. // },
  55. // Build Configuration: https://go.nuxtjs.dev/config-build
  56. build: {
  57. transpile: [/^element-ui/],
  58. }
  59. }