nuxt.config.js 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  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. /*
  25. ** Plugins to load before mounting the App
  26. */
  27. plugins: [
  28. { src: '~plugins/axios', ssr: true },
  29. ],
  30. /*
  31. ** Nuxt.js modules
  32. */
  33. modules: [
  34. // Doc: https://axios.nuxtjs.org/usage
  35. '@nuxtjs/axios',
  36. '@nuxtjs/proxy',
  37. // Doc: https://bootstrap-vue.js.org/docs/
  38. 'bootstrap-vue/nuxt',
  39. '@nuxtjs/pwa',
  40. ],
  41. /*
  42. ** Axios module configuration
  43. */
  44. axios: {
  45. // See https://github.com/nuxt-community/axios-module#options
  46. },
  47. proxy: [
  48. [
  49. '/api',
  50. {
  51. target: 'https://gcb.china0001.com.cn/pubdata', // api主机
  52. pathRewrite: { '^/api' : '/' }
  53. }
  54. ]
  55. ],
  56. /*
  57. ** Build configuration
  58. */
  59. build: {
  60. /*
  61. ** You can extend webpack config here
  62. */
  63. extend(config, ctx) {
  64. // Run ESLint on save
  65. // if (ctx.isDev && ctx.isClient) {
  66. // config.module.rules.push({
  67. // enforce: 'pre',
  68. // test: /\.(js|vue)$/,
  69. // loader: 'eslint-loader',
  70. // exclude: /(node_modules)/
  71. // })
  72. // }
  73. const sassResourcesLoader = {
  74. loader: 'sass-resources-loader',
  75. options: {
  76. resources: [
  77. 'assets/cyc.scss'
  78. ]
  79. }
  80. }
  81. }
  82. }
  83. }