nuxt.config.ts 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  1. import path from 'path'
  2. const colors = require('vuetify/es5/util/colors').default
  3. export default {
  4. mode: 'universal',
  5. /*
  6. ** Headers of the page
  7. */
  8. head: {
  9. titleTemplate: '%s - ' + process.env.npm_package_name,
  10. title: process.env.npm_package_name || '',
  11. meta: [
  12. { charset: 'utf-8' },
  13. { name: 'viewport', content: 'width=device-width, initial-scale=1' },
  14. {
  15. hid: 'description',
  16. name: 'description',
  17. content: process.env.npm_package_description || ''
  18. }
  19. ],
  20. link: [{ rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' }]
  21. },
  22. /*
  23. ** Customize the progress-bar color
  24. */
  25. loading: { color: '#fff' },
  26. /*
  27. ** Global CSS
  28. */
  29. css: [
  30. 'katex/dist/katex.min.css',
  31. 'github-markdown-css/github-markdown.css',
  32. 'prismjs/themes/prism-tomorrow.css'
  33. ],
  34. /*
  35. ** Plugins to load before mounting the App
  36. */
  37. plugins: [{ src: '~/plugins/codemirror.ts', mode: 'client' }],
  38. /*
  39. ** Nuxt.js dev-modules
  40. */
  41. buildModules: ['@nuxtjs/vuetify', '@nuxt/typescript-build', 'nuxt-typed-vuex'],
  42. /*
  43. ** Nuxt.js modules
  44. */
  45. modules: [
  46. // Doc: https://axios.nuxtjs.org/usage
  47. '@nuxtjs/axios',
  48. 'nuxt-i18n'
  49. ],
  50. i18n: {
  51. locales: ['zh-CN'],
  52. defaultLocale: 'zh-CN',
  53. vueI18n: {
  54. fallbackLocale: 'zh-CN',
  55. messages: {
  56. 'zh-CN': require('./locales/zh-CN.json')
  57. }
  58. }
  59. },
  60. /*
  61. ** Axios module configuration
  62. ** See https://axios.nuxtjs.org/options
  63. */
  64. axios: {
  65. baseURL: 'http://localhost:9090'
  66. },
  67. /*
  68. ** vuetify module configuration
  69. ** https://github.com/nuxt-community/vuetify-module
  70. */
  71. vuetify: {
  72. customVariables: ['~/assets/variables.sass'],
  73. theme: {
  74. // dark: false,
  75. themes: {
  76. dark: {
  77. primary: colors.purple.darken2,
  78. accent: colors.grey.darken3,
  79. secondary: colors.amber.darken3,
  80. info: colors.teal.lighten1,
  81. warning: colors.amber.base,
  82. error: colors.deepOrange.accent4,
  83. success: colors.green.accent3
  84. }
  85. // light: {
  86. // primary: colors.purple.darken1,
  87. // accent: colors.grey.darken3,
  88. // secondary: colors.amber.darken3,
  89. // info: colors.teal.lighten1,
  90. // warning: colors.amber.base,
  91. // error: colors.deepOrange.accent4,
  92. // success: colors.green.accent3
  93. // }
  94. }
  95. }
  96. },
  97. typescript: {
  98. typeCheck: {
  99. eslint: true
  100. }
  101. },
  102. /*
  103. ** Build configuration
  104. */
  105. build: {
  106. /*
  107. ** You can extend webpack config here
  108. */
  109. transpile: [/typed-vuex/],
  110. extend(config: any) {
  111. config.module.rules.push({
  112. test: /\.md$/,
  113. use: [{ loader: 'html-loader' }, { loader: path.resolve('./util/markdown/markdown-loader.ts') }]
  114. })
  115. config.module.rules.push({
  116. test: /\.scss$/,
  117. use: [
  118. 'vue-style-loader',
  119. 'css-loader',
  120. {
  121. loader: 'sass-loader',
  122. options: {
  123. indentedSyntax: true,
  124. // sass-loader version >= 8
  125. sassOptions: {
  126. indentedSyntax: true
  127. }
  128. }
  129. }
  130. ]
  131. })
  132. }
  133. }
  134. }