nuxt.config.js 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. const pkg = require('./package')
  2. module.exports = {
  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: [
  15. { rel: 'stylesheet', type: 'text/css', href: '/swiper.min.css' },
  16. { rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' },
  17. ]
  18. },
  19. /*
  20. ** Customize the progress-bar color
  21. */
  22. loading: { color: '#fff' },
  23. /*
  24. ** Global CSS
  25. */
  26. css: [
  27. "iview/dist/styles/iview.css",
  28. "@/assets/style/index.scss",
  29. "@/assets/iconfont/iconfont.css",
  30. ],
  31. /*
  32. ** Plugins to load before mounting the App
  33. */
  34. plugins: [
  35. { src: '~plugins/iview.js', ssr: true },
  36. { src: '~plugins/lazy.js', ssr: true },
  37. { src: '~assets/iconfont/iconfont.js', ssr: false },
  38. { src: '~plugins/plugins.js', ssr: false },
  39. ],
  40. /*
  41. ** Nuxt.js modules
  42. */
  43. modules: [
  44. '@nuxtjs/axios',
  45. ],
  46. /*
  47. ** Axios module configuration
  48. */
  49. axios: {
  50. // See https://github.com/nuxt-community/axios-module#options
  51. // prefix: '/api/',
  52. // proxy: true // Can be also an object with default options
  53. },
  54. // proxy: {
  55. // '/api/': { target: 'http://localhost:8080', pathRewrite: {'^/api/': ''} }
  56. // },
  57. /*
  58. ** Build configuration
  59. */
  60. build: {
  61. /*
  62. ** You can extend webpack config here
  63. */
  64. vendor: ['external_library'],
  65. extend(config, { isDev, isClient }) {
  66. // const vueLoader = config.module.rules.find((rule) => rule.loader === 'vue-loader');
  67. //
  68. // vueLoader.options.loaders.sass = 'vue-style-loader!css-loader!sass-loader';
  69. }
  70. }
  71. }