nuxt.config.js 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. import pkg from './package'
  2. export default {
  3. mode: 'universal',
  4. /*
  5. ** Headers of the page
  6. */
  7. head: {
  8. title: pkg.name,
  9. meta: [
  10. { charset: 'utf-8' },
  11. { name: 'viewport', content: 'width=device-width, initial-scale=1' },
  12. { hid: 'description', name: 'description', content: pkg.description }
  13. ],
  14. link: [{ rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' }]
  15. },
  16. /*
  17. ** Customize the progress-bar color
  18. */
  19. loading: { color: '#fff' },
  20. /*
  21. ** Global CSS
  22. */
  23. css: [
  24. { src: "swiper/dist/css/swiper.css" }
  25. ],
  26. /*
  27. ** Plugins to load before mounting the App
  28. */
  29. plugins: [
  30. { src: '~plugins/axios', ssr: true },
  31. { src: "~/plugins/vue-swiper.js", ssr: true },
  32. ],
  33. /*
  34. ** Nuxt.js modules
  35. */
  36. modules: [
  37. // Doc: https://axios.nuxtjs.org/usage
  38. '@nuxtjs/axios',
  39. '@nuxtjs/proxy',
  40. // Doc: https://bootstrap-vue.js.org/docs/
  41. 'bootstrap-vue/nuxt',
  42. '@nuxtjs/pwa',
  43. ],
  44. /*
  45. ** Axios module configuration
  46. */
  47. axios: {
  48. // See https://github.com/nuxt-community/axios-module#options
  49. },
  50. proxy: [
  51. [
  52. '/api',
  53. {
  54. target: 'https://gcb.china0001.com.cn/pubdata', // api主机
  55. pathRewrite: { '^/api' : '/' }
  56. }
  57. ]
  58. ],
  59. /*
  60. ** Build configuration
  61. */
  62. build: {
  63. /*
  64. ** You can extend webpack config here
  65. */
  66. extend(config, ctx) {
  67. // Run ESLint on save
  68. // if (ctx.isDev && ctx.isClient) {
  69. // config.module.rules.push({
  70. // enforce: 'pre',
  71. // test: /\.(js|vue)$/,
  72. // loader: 'eslint-loader',
  73. // exclude: /(node_modules)/
  74. // })
  75. // }
  76. const sassResourcesLoader = {
  77. loader: 'sass-resources-loader',
  78. options: {
  79. resources: [
  80. 'assets/cyc.scss'
  81. ]
  82. }
  83. }
  84. }
  85. }
  86. }