nuxt.config.js 3.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. import dotenv from 'dotenv/config';
  2. import autoprefixer from 'autoprefixer';
  3. import serveStatic from 'serve-static';
  4. import path from 'path';
  5. export default {
  6. server: {
  7. port: process.env.WEBSITE_PORT
  8. },
  9. env: {
  10. version: process.env.npm_package_version,
  11. URL: process.env.DOMAIN,
  12. baseURL: `${process.env.DOMAIN}${process.env.ROUTE_PREFIX}`,
  13. serviceName: process.env.SERVICE_NAME,
  14. maxFileSize: process.env.MAX_SIZE,
  15. chunkSize: process.env.CHUNK_SIZE,
  16. maxLinksPerAlbum: process.env.MAX_LINKS_PER_ALBUM,
  17. publicMode: process.env.PUBLIC_MODE,
  18. userAccounts: process.env.USER_ACCOUNTS
  19. },
  20. srcDir: 'src/site/',
  21. head: {
  22. title: process.env.SERVICE_NAME,
  23. titleTemplate: `%s | ${process.env.SERVICE_NAME}`,
  24. // TODO: Add the directory with pictures for favicon and stuff
  25. meta: [
  26. { charset: 'utf-8' },
  27. { name: 'viewport', content: 'width=device-width, initial-scale=1' },
  28. { hid: 'theme-color', name: 'theme-color', content: `${process.env.META_THEME_COLOR}` },
  29. { hid: 'description', name: 'description', content: `${process.env.META_DESCRIPTION}` },
  30. { hid: 'keywords', name: 'keywords', content: `${process.env.META_KEYWORDS}` },
  31. { hid: 'apple-mobile-web-app-title', name: 'apple-mobile-web-app-title', content: `${process.env.SERVICE_NAME}` },
  32. { hid: 'application-name', name: 'application-name', content: `${process.env.SERVICE_NAME}` },
  33. // { hid: 'msapplication-config', name: 'msapplication-config', content: `${process.env.DOMAIN}/browserconfig.xml` },
  34. { hid: 'twitter:card', name: 'twitter:card', content: 'summary_large_image' },
  35. { hid: 'twitter:site', name: 'twitter:site', content: `${process.env.META_TWITTER_HANDLE}` },
  36. { hid: 'twitter:creator', name: 'twitter:creator', content: `${process.env.META_TWITTER_HANDLE}` },
  37. { hid: 'twitter:title', name: 'twitter:title', content: `${process.env.SERVICE_NAME}` },
  38. { hid: 'twitter:description', name: 'twitter:description', content: `${process.env.META_DESCRIPTION}` },
  39. { hid: 'twitter:image', name: 'twitter:image', content: `${process.env.DOMAIN}/share.jpg` },
  40. { hid: 'og:url', property: 'og:url', content: `${process.env.DOMAIN}` },
  41. { hid: 'og:type', property: 'og:type', content: 'website' },
  42. { hid: 'og:title', property: 'og:title', content: `${process.env.SERVICE_NAME}` },
  43. { hid: 'og:description', property: 'og:description', content: `${process.env.META_DESCRIPTION}` },
  44. { hid: 'og:image', property: 'og:image', content: `${process.env.DOMAIN}/share.jpg` },
  45. { hid: 'og:image:secure_url', property: 'og:image:secure_url', content: `${process.env.DOMAIN}/share.jpg` },
  46. { hid: 'og:site_name', property: 'og:site_name', content: `${process.env.SERVICE_NAME}` }
  47. ],
  48. link: [
  49. { rel: 'stylesheet', href: 'https://fonts.googleapis.com/css?family=Nunito:300,400,600,700' },
  50. // This one is a pain in the ass to make it customizable, so you should edit it manually
  51. { type: 'application/json+oembed', href: `${process.env.DOMAIN}/oembed.json` }
  52. ]
  53. },
  54. plugins: [
  55. '~/plugins/axios',
  56. '~/plugins/buefy',
  57. '~/plugins/v-clipboard',
  58. '~/plugins/vue-isyourpasswordsafe',
  59. '~/plugins/vue-timeago',
  60. '~/plugins/flexsearch'
  61. ],
  62. serverMiddleware: [
  63. { path: '/', handler: serveStatic(path.join(__dirname, 'uploads')) }
  64. ],
  65. css: [],
  66. modules: [
  67. '@nuxtjs/axios'
  68. ],
  69. axios: {
  70. baseURL: `${process.env.DOMAIN}${process.env.ROUTE_PREFIX}`
  71. },
  72. build: {
  73. extractCSS: true,
  74. postcss: [
  75. autoprefixer
  76. ]
  77. }
  78. };