v3.0.0/nuxt.config.js

101 lines
3.9 KiB
JavaScript
Raw Normal View History

2019-02-21 15:49:48 +01:00
import dotenv from 'dotenv/config';
2018-09-19 09:45:50 +02:00
import autoprefixer from 'autoprefixer';
import jetpack from 'fs-jetpack';
const clientConfig = {
development: process.env.NODE_ENV !== 'production',
version: process.env.npm_package_version,
URL: process.env.DOMAIN,
baseURL: `${process.env.DOMAIN}${process.env.ROUTE_PREFIX}`,
serviceName: process.env.SERVICE_NAME,
2020-05-10 15:16:16 +02:00
maxFileSize: parseInt(process.env.MAX_SIZE, 10),
chunkSize: parseInt(process.env.CHUNK_SIZE, 10),
maxLinksPerAlbum: parseInt(process.env.MAX_LINKS_PER_ALBUM, 10),
2020-07-07 01:02:59 +02:00
publicMode: process.env.PUBLIC_MODE === 'true',
userAccounts: process.env.USER_ACCOUNTS === 'true',
};
2018-09-19 09:45:50 +02:00
export default {
mode: 'spa',
2018-09-19 09:45:50 +02:00
server: {
2020-07-07 01:02:59 +02:00
port: process.env.WEBSITE_PORT,
2019-02-19 15:52:24 +01:00
},
2018-09-19 09:45:50 +02:00
srcDir: 'src/site/',
head: {
2019-03-12 08:43:14 +01:00
title: process.env.SERVICE_NAME,
titleTemplate: `%s | ${process.env.SERVICE_NAME}`,
// TODO: Add the directory with pictures for favicon and stuff
2018-09-19 09:45:50 +02:00
meta: [
{ charset: 'utf-8' },
2019-03-12 08:43:14 +01:00
{ name: 'viewport', content: 'width=device-width, initial-scale=1' },
2019-03-12 09:17:37 +01:00
{ hid: 'theme-color', name: 'theme-color', content: `${process.env.META_THEME_COLOR}` },
{ hid: 'description', name: 'description', content: `${process.env.META_DESCRIPTION}` },
{ hid: 'keywords', name: 'keywords', content: `${process.env.META_KEYWORDS}` },
{
hid: 'apple-mobile-web-app-title',
name: 'apple-mobile-web-app-title',
2020-07-07 01:02:59 +02:00
content: `${process.env.SERVICE_NAME}`,
},
2019-03-12 09:17:37 +01:00
{ hid: 'application-name', name: 'application-name', content: `${process.env.SERVICE_NAME}` },
2019-03-12 08:43:14 +01:00
// { hid: 'msapplication-config', name: 'msapplication-config', content: `${process.env.DOMAIN}/browserconfig.xml` },
{ hid: 'twitter:card', name: 'twitter:card', content: 'summary_large_image' },
2019-03-12 09:17:37 +01:00
{ hid: 'twitter:site', name: 'twitter:site', content: `${process.env.META_TWITTER_HANDLE}` },
{ hid: 'twitter:creator', name: 'twitter:creator', content: `${process.env.META_TWITTER_HANDLE}` },
{ hid: 'twitter:title', name: 'twitter:title', content: `${process.env.SERVICE_NAME}` },
{ hid: 'twitter:description', name: 'twitter:description', content: `${process.env.META_DESCRIPTION}` },
2019-03-12 08:43:14 +01:00
{ hid: 'twitter:image', name: 'twitter:image', content: `${process.env.DOMAIN}/share.jpg` },
2019-03-12 09:17:37 +01:00
{ hid: 'og:url', property: 'og:url', content: `${process.env.DOMAIN}` },
2019-03-12 08:43:14 +01:00
{ hid: 'og:type', property: 'og:type', content: 'website' },
2019-03-12 09:17:37 +01:00
{ hid: 'og:title', property: 'og:title', content: `${process.env.SERVICE_NAME}` },
{ hid: 'og:description', property: 'og:description', content: `${process.env.META_DESCRIPTION}` },
2019-03-12 08:43:14 +01:00
{ hid: 'og:image', property: 'og:image', content: `${process.env.DOMAIN}/share.jpg` },
{ hid: 'og:image:secure_url', property: 'og:image:secure_url', content: `${process.env.DOMAIN}/share.jpg` },
2020-07-07 01:02:59 +02:00
{ hid: 'og:site_name', property: 'og:site_name', content: `${process.env.SERVICE_NAME}` },
2018-09-19 09:45:50 +02:00
],
link: [
2019-03-12 08:43:14 +01:00
{ rel: 'stylesheet', href: 'https://fonts.googleapis.com/css?family=Nunito:300,400,600,700' },
// This one is a pain in the ass to make it customizable, so you should edit it manually
2020-07-07 01:02:59 +02:00
{ type: 'application/json+oembed', href: `${process.env.DOMAIN}/oembed.json` },
],
2018-09-19 09:45:50 +02:00
},
plugins: [
2019-03-28 16:35:22 +01:00
'~/plugins/axios',
2018-09-19 09:45:50 +02:00
'~/plugins/buefy',
'~/plugins/v-clipboard',
'~/plugins/vue-isyourpasswordsafe',
2019-03-29 04:28:16 +01:00
'~/plugins/vue-timeago',
2019-10-01 19:20:37 +02:00
'~/plugins/flexsearch',
'~/plugins/vuebar',
2020-07-07 01:02:59 +02:00
'~/plugins/nuxt-client-init',
'~/plugins/notifier',
2020-07-09 01:23:32 +02:00
'~/plugins/handler',
2018-09-19 09:45:50 +02:00
],
css: [],
modules: ['@nuxtjs/axios', 'cookie-universal-nuxt'],
router: {
linkActiveClass: 'is-active',
linkExactActiveClass: 'is-active',
},
2019-03-28 16:35:22 +01:00
axios: {
2020-07-07 01:02:59 +02:00
baseURL: `${process.env.DOMAIN}${process.env.ROUTE_PREFIX}`,
2019-03-28 16:35:22 +01:00
},
2018-09-19 09:45:50 +02:00
build: {
extractCSS: true,
postcss: {
preset: {
2020-07-07 01:02:59 +02:00
autoprefixer,
},
},
extend(config, { isClient, isDev }) {
// Extend only webpack config for client-bundle
if (isClient) {
jetpack.write('dist/config.json', clientConfig);
}
if (isDev) {
config.devtool = isClient ? 'source-map' : 'inline-source-map';
}
2020-07-07 01:02:59 +02:00
},
},
2018-09-19 09:45:50 +02:00
};