nuxt.config.js 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  1. const webpack = require('webpack')
  2. export default {
  3. /*
  4. ** Nuxt rendering mode
  5. ** See https://nuxtjs.org/api/configuration-mode
  6. */
  7. mode: 'universal',
  8. /*
  9. ** Nuxt target
  10. ** See https://nuxtjs.org/api/configuration-target
  11. */
  12. target: 'server',
  13. /*
  14. ** Headers of the page
  15. ** See https://nuxtjs.org/api/configuration-head
  16. 逻辑狗官网 - 中德智慧教育
  17. 关键词:逻辑狗官网、逻辑狗教材、逻辑狗课程、逻辑狗思维训练课程、儿童思维教育、0-12岁儿童
  18. 描述:逻辑狗官方网站,专为0-12岁儿童设计的思维训练课程,中德智慧教育,全球优质教育内容输出平台
  19. */
  20. head: {
  21. title: '逻辑狗官网-中德智慧教育',
  22. meta: [
  23. { name: 'renderer', content: 'webkit'},
  24. { name: 'force-rendering', content: 'webkit'},
  25. { 'http-equiv': 'X-UA-Compatible', content: 'IE=Edge,chrome=1'},
  26. { name: 'baidu-site-verification', content: 'mREHhDF8nW'},
  27. /*以上是设置双核浏览器默认状态下使用极速模式打开*/
  28. { charset: 'utf-8' },
  29. { hid: 'description', name: 'description', content: '中德智慧教育'},
  30. { name: 'format-detection', content: 'telephone=no' },
  31. { name: 'viewport', content: 'width=device-width, initial-scale=1.0, user-scalable=no' },
  32. /*新增搜狗、神马、360 */
  33. // { name: '360-site-verification', content: '850970beabd63bd397272b6dd73a1aba' },
  34. // { name: 'sogou_site_verification', content: 'y3fi8ttkxP' },
  35. // { name: 'shenma-site-verification', content: '15230d9dfb2e66bfecf2408862f2462c_1537497601' }
  36. ],
  37. link: [
  38. { rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' },
  39. { rel: 'stylesheet', href: '/common/common.css' }
  40. ],
  41. script: [
  42. { src: 'https://hm.baidu.com/hm.js?2a45c0311559f89f2ee65d1ac438d204' }
  43. ]
  44. },
  45. /*
  46. ** Global CSS
  47. */
  48. css: [
  49. 'element-ui/lib/theme-chalk/index.css',
  50. '~assets/css/reset.css',
  51. '~assets/css/animate.css',
  52. 'swiper/css/swiper.css'
  53. ],
  54. /*
  55. ** Plugins to load before mounting the App
  56. ** https://nuxtjs.org/guide/plugins
  57. */
  58. plugins: [
  59. { src: '@/plugins/element-ui', ssr: false },
  60. { src: "@/plugins/vue-swiper", ssr: false },
  61. {
  62. src: '@/plugins/filter.js'
  63. },
  64. { src: '~/plugins/baidu.js' }
  65. ],
  66. /*
  67. ** Auto import components
  68. ** See https://nuxtjs.org/api/configuration-components
  69. */
  70. components: true,
  71. /*
  72. ** Nuxt.js dev-modules
  73. */
  74. buildModules: [
  75. ],
  76. /*
  77. ** Nuxt.js modules
  78. */
  79. modules: [
  80. ],
  81. /*
  82. ** Build configuration
  83. ** See https://nuxtjs.org/api/configuration-build/
  84. */
  85. build: {
  86. transpile: [/^element-ui/],
  87. extractCSS: {
  88. allChunks: true
  89. },
  90. // extractCSS: true,
  91. // optimization: {
  92. // splitChunks: {
  93. // cacheGroups: {
  94. // commons: {
  95. // test: /[\\/]node_modules[\\/]/,
  96. // name: "vendor",
  97. // chunks: "all"
  98. // }
  99. // }
  100. // }
  101. // },
  102. vender: ['axios'],
  103. extend (config, { isDev, isClient }) {
  104. if (isDev && isClient) {
  105. config.module.rules.push({
  106. enforce: 'pre',
  107. test: /\.(js|vue)$/,
  108. loader: 'eslint-loader',
  109. exclude: /(node_modules)/
  110. })
  111. }
  112. },
  113. plugins: [
  114. new webpack.ProvidePlugin({
  115. '$' : 'jquery'
  116. })
  117. ]
  118. },
  119. cache: true,
  120. //禁止预加载效果
  121. performance: {
  122. prefetch: false
  123. },
  124. }