nuxt.config.js 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. /*
  2. * @Description:
  3. * @Author: 欧阳承珺
  4. * @LastEditors: 欧阳承珺
  5. * @Date: 2022-10-17 11:06:52
  6. * @LastEditTime: 2022-11-16 16:42:17
  7. */
  8. export default {
  9. // Global page headers: https://go.nuxtjs.dev/config-head
  10. head: {
  11. title: '',
  12. htmlAttrs: {
  13. lang: 'en',
  14. },
  15. meta: [
  16. { charset: 'utf-8' },
  17. { name: 'viewport', content: 'width=device-width, initial-scale=1' },
  18. { hid: 'description', name: 'description', content: '' },
  19. { name: 'format-detection', content: 'telephone=no' },
  20. ],
  21. link: [{ rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' }],
  22. },
  23. env: {
  24. BASE_URL: process.env.BASE_URL,
  25. NODE_ENV: process.env.NODE_ENV,
  26. MODE_ENV: process.env.MODE_ENV
  27. },
  28. // Global CSS: https://go.nuxtjs.dev/config-css
  29. css: [
  30. '@/assets/main.scss',
  31. {src:'element-ui/lib/theme-chalk/index.css'},
  32. ],
  33. // Plugins to run before rendering page: https://go.nuxtjs.dev/config-plugins
  34. plugins: [
  35. '~/plugins/axios',
  36. {
  37. src: '~plugins/ga.js',
  38. ssr: false
  39. },
  40. {src: '~plugins/element-ui', ssr: false},
  41. // {src: '@/plugins/localStorage', ssr: false},
  42. {src: '@/plugins/vueqr', ssr: false},
  43. { src: "~/plugins/vue-swiper.js", ssr: false }
  44. ],
  45. // Auto import components: https://go.nuxtjs.dev/config-components
  46. components: true,
  47. // Modules for dev and build (recommended): https://go.nuxtjs.dev/config-modules
  48. buildModules: [
  49. // https://go.nuxtjs.dev/typescript
  50. '@nuxt/typescript-build',
  51. // https://windicss.org/guide/
  52. 'nuxt-windicss',
  53. '@nuxtjs/composition-api/module',
  54. '@nuxtjs/svg'
  55. ],
  56. publicRuntimeConfig: {
  57. pdfDomain: process.env.MODE_ENV === 'production' ? 'https://content.pdfreaderpro.com' : 'https://test-pdf-pro.kdan.cn:3020',
  58. PDFReaderPro: process.env.MODE_ENV === 'production' ? 'https://www.pdfreaderpro.com' : 'http://test-pdf-pro.kdan.cn:3021',
  59. },
  60. // Modules: https://go.nuxtjs.dev/config-modules
  61. modules: [
  62. '@nuxtjs/axios',
  63. '@nuxtjs/proxy',
  64. ],
  65. axios: {
  66. timeout: 3000,
  67. baseURL: process.env.BASE_URL,
  68. // prefix: '/17pdf-backend-core',
  69. },
  70. // proxy: {
  71. // '/17pdf-backend-core': { target: 'http://81.68.234.235:8999',}
  72. // },
  73. // Build Configuration: https://go.nuxtjs.dev/config-build
  74. build: {
  75. vendor: ['element-ui']
  76. },
  77. loading: false,
  78. //用户输入不存在的路径,跳到首页
  79. router: {
  80. extendRoutes(routes, resolve) {
  81. routes.push({
  82. path: '*',
  83. redirect: '/'
  84. })
  85. }
  86. }
  87. }