nuxt.config.ts 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. import vuetify, { transformAssetUrls } from 'vite-plugin-vuetify'
  2. export default defineNuxtConfig({
  3. ssr: true,
  4. target: 'static',
  5. title: 'Path-PHP Documentation',
  6. devtools: {
  7. // @see https://github.com/nuxt/devtools
  8. enabled: true,
  9. },
  10. app: {
  11. head: {
  12. title: 'Path-PHP Documentation',
  13. meta: [
  14. { charset: 'utf-8' },
  15. { name: 'viewport', content: 'width=device-width, initial-scale=1' },
  16. ],
  17. link: [
  18. { rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' },
  19. ],
  20. htmlAttrs: {
  21. lang: 'en-US'
  22. }
  23. },
  24. },
  25. build: {
  26. transpile: ['vuetify'],
  27. },
  28. hooks: {
  29. 'builder:watch': console.log,
  30. },
  31. css: [
  32. 'vuetify/lib/styles/main.sass'
  33. ],
  34. modules: [
  35. async (_, nuxt) => {
  36. nuxt.hooks.hook('vite:extendConfig', (config) =>
  37. // @ts-expect-error A revoir après que les lignes aient été décommentées
  38. (config.plugins ?? []).push(
  39. vuetify()
  40. // Remplacer par cela quand l'issue https://github.com/vuetifyjs/vuetify-loader/issues/273 sera règlée..
  41. // voir aussi : https://github.com/nuxt/nuxt/issues/15412 et https://github.com/vuetifyjs/vuetify-loader/issues/290
  42. // voir aussi : https://github.com/jrutila/nuxt3-vuetify3-bug
  43. // vuetify({
  44. // styles: { configFile: './assets/css/settings.scss' }
  45. // })
  46. )
  47. )
  48. },
  49. 'nuxt-lodash',
  50. '@nuxt/devtools',
  51. '@nuxtjs/sitemap',
  52. ],
  53. webfontloader: {
  54. google: {
  55. families: ['Barlow:300,400,500,700&display=swap'],
  56. },
  57. },
  58. vite: {
  59. esbuild: {
  60. drop: process.env.DEBUG ? [] : ['console', 'debugger'],
  61. tsconfigRaw: {
  62. compilerOptions: {
  63. experimentalDecorators: true,
  64. },
  65. },
  66. },
  67. ssr: {
  68. noExternal: ['vuetify'],
  69. },
  70. vue: {
  71. template: {
  72. transformAssetUrls,
  73. },
  74. },
  75. },
  76. router: {
  77. options: {
  78. scrollBehaviorType: 'smooth',
  79. },
  80. },
  81. site: {
  82. url: 'https://path-php.net'
  83. },
  84. })