2020-11-16 19:16:39 +00:00
|
|
|
/* eslint-disable @typescript-eslint/ban-ts-comment */
|
2020-09-02 18:34:50 +00:00
|
|
|
import type { NuxtConfig } from '@nuxt/types';
|
2020-12-09 18:08:03 +00:00
|
|
|
import webpack from 'webpack';
|
2020-09-02 18:34:50 +00:00
|
|
|
|
|
|
|
const config: NuxtConfig = {
|
|
|
|
/*
|
|
|
|
** Nuxt rendering mode
|
|
|
|
** See https://nuxtjs.org/api/configuration-mode
|
|
|
|
*/
|
2021-01-19 01:51:17 +00:00
|
|
|
ssr: !!process.env.NUXT_SSR,
|
2020-11-09 21:00:34 +00:00
|
|
|
/*
|
2020-11-10 13:51:18 +00:00
|
|
|
** Disables telemetry prompt while installing dependencies
|
|
|
|
** See https://github.com/nuxt/telemetry
|
|
|
|
*/
|
2020-11-09 21:00:34 +00:00
|
|
|
telemetry: false,
|
2020-09-02 18:34:50 +00:00
|
|
|
/*
|
|
|
|
** Nuxt target
|
|
|
|
** See https://nuxtjs.org/api/configuration-target
|
|
|
|
*/
|
2020-09-03 05:57:42 +00:00
|
|
|
target: 'server',
|
2020-09-17 08:03:14 +00:00
|
|
|
/*
|
|
|
|
** Module loading mode
|
|
|
|
** See https://nuxtjs.org/api/configuration-modern
|
|
|
|
*/
|
|
|
|
modern: 'client',
|
2020-10-22 18:28:19 +00:00
|
|
|
/*
|
|
|
|
** Progress bar between routes
|
|
|
|
** See https://nuxtjs.org/api/configuration-loading
|
|
|
|
*/
|
2020-11-13 22:18:05 +00:00
|
|
|
loading: {
|
|
|
|
color: '#00A4DC',
|
|
|
|
failedColor: '#FF5252',
|
|
|
|
height: '4px'
|
|
|
|
},
|
2020-12-17 23:27:39 +00:00
|
|
|
pwa: {
|
|
|
|
meta: {
|
|
|
|
nativeUI: true,
|
2021-02-22 20:12:52 +00:00
|
|
|
appleStatusBarStyle: 'black-translucent',
|
2020-12-17 23:27:39 +00:00
|
|
|
name: 'Jellyfin',
|
|
|
|
theme_color: '#424242'
|
|
|
|
},
|
|
|
|
manifest: {
|
|
|
|
name: 'Jellyfin',
|
|
|
|
background_color: '#101010'
|
|
|
|
}
|
|
|
|
},
|
2020-09-02 18:34:50 +00:00
|
|
|
/*
|
|
|
|
** Headers of the page
|
|
|
|
** See https://nuxtjs.org/api/configuration-head
|
|
|
|
*/
|
|
|
|
head: {
|
2020-09-19 02:03:59 +00:00
|
|
|
titleTemplate: '%s - Jellyfin',
|
|
|
|
title: 'Jellyfin',
|
2020-09-02 18:34:50 +00:00
|
|
|
meta: [
|
|
|
|
{ charset: 'utf-8' },
|
2021-02-11 11:57:12 +00:00
|
|
|
{
|
|
|
|
name: 'viewport',
|
|
|
|
content:
|
|
|
|
'width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1, user-scalable=no, viewport-fit=cover'
|
|
|
|
},
|
2020-09-02 18:34:50 +00:00
|
|
|
{
|
|
|
|
hid: 'description',
|
|
|
|
name: 'description',
|
|
|
|
content: process.env.npm_package_description || ''
|
|
|
|
}
|
|
|
|
],
|
|
|
|
link: [{ rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' }]
|
|
|
|
},
|
|
|
|
/*
|
|
|
|
** Global CSS
|
|
|
|
*/
|
2020-11-05 23:15:34 +00:00
|
|
|
css: ['~/assets/global.scss', '@mdi/font/css/materialdesignicons.css'],
|
2020-09-02 18:34:50 +00:00
|
|
|
/*
|
|
|
|
** Plugins to load before mounting the App
|
|
|
|
** https://nuxtjs.org/guide/plugins
|
|
|
|
*/
|
2020-09-04 12:07:12 +00:00
|
|
|
plugins: [
|
2020-12-31 03:26:14 +00:00
|
|
|
// Development
|
|
|
|
'plugins/axe.ts',
|
2020-11-08 22:08:03 +00:00
|
|
|
// General
|
2021-01-28 18:24:46 +00:00
|
|
|
'plugins/persistedState.ts',
|
|
|
|
'plugins/appInitPlugin.ts',
|
2020-12-02 17:06:19 +00:00
|
|
|
'plugins/veeValidate.ts',
|
2020-12-17 18:27:02 +00:00
|
|
|
'plugins/nativeWebsocketPlugin.ts',
|
2020-09-06 02:25:15 +00:00
|
|
|
// Components
|
2021-01-19 01:51:17 +00:00
|
|
|
{ src: 'plugins/components/swiper.ts', mode: 'client' },
|
2020-09-25 22:45:22 +00:00
|
|
|
'plugins/components/vueVirtualScroller.ts',
|
2020-12-03 14:15:52 +00:00
|
|
|
'plugins/components/veeValidate.ts',
|
2021-01-19 17:57:30 +00:00
|
|
|
'plugins/components/vueDraggable.ts',
|
2020-09-06 02:25:15 +00:00
|
|
|
// Utility
|
2021-01-19 01:51:17 +00:00
|
|
|
{ src: 'plugins/browserDetection.ts', mode: 'client' },
|
|
|
|
{ src: 'plugins/playbackProfile.ts', mode: 'client' },
|
2020-10-09 17:53:05 +00:00
|
|
|
'plugins/apiPlugin.ts'
|
2020-09-04 12:07:12 +00:00
|
|
|
],
|
2020-09-02 18:34:50 +00:00
|
|
|
/*
|
|
|
|
** Auto import components
|
|
|
|
** See https://nuxtjs.org/api/configuration-components
|
|
|
|
*/
|
|
|
|
components: true,
|
|
|
|
/*
|
|
|
|
** Nuxt.js dev-modules
|
|
|
|
*/
|
|
|
|
buildModules: [
|
|
|
|
'@nuxt/typescript-build',
|
|
|
|
// Doc: https://github.com/nuxt-community/stylelint-module
|
|
|
|
'@nuxtjs/stylelint-module',
|
2020-10-22 17:17:15 +00:00
|
|
|
'@nuxtjs/vuetify',
|
2021-01-05 00:35:59 +00:00
|
|
|
'@nuxtjs/date-fns',
|
|
|
|
'@nuxtjs/imagemin'
|
2020-09-02 18:34:50 +00:00
|
|
|
],
|
|
|
|
/*
|
|
|
|
** Nuxt.js modules
|
|
|
|
*/
|
|
|
|
modules: [
|
2020-09-05 21:27:26 +00:00
|
|
|
'nuxt-i18n',
|
2020-09-04 21:55:21 +00:00
|
|
|
[
|
|
|
|
'nuxt-vuex-localstorage',
|
|
|
|
{
|
2021-01-28 18:24:46 +00:00
|
|
|
localStorage: ['user', 'deviceProfile']
|
2020-09-04 21:55:21 +00:00
|
|
|
}
|
|
|
|
],
|
2020-09-05 21:27:26 +00:00
|
|
|
// Doc: https://axios.nuxtjs.org/usage
|
2020-09-02 18:34:50 +00:00
|
|
|
'@nuxtjs/axios',
|
2020-11-08 22:08:03 +00:00
|
|
|
'@nuxtjs/auth',
|
2020-09-02 18:34:50 +00:00
|
|
|
'@nuxtjs/pwa'
|
|
|
|
],
|
2020-09-02 22:05:48 +00:00
|
|
|
/*
|
|
|
|
** Router configuration
|
|
|
|
*/
|
|
|
|
router: {
|
|
|
|
middleware: ['auth']
|
|
|
|
},
|
2020-09-02 18:34:50 +00:00
|
|
|
/*
|
|
|
|
** Axios module configuration
|
|
|
|
** See https://axios.nuxtjs.org/options
|
|
|
|
*/
|
2020-11-26 07:39:36 +00:00
|
|
|
axios: {
|
|
|
|
baseURL: ''
|
|
|
|
},
|
2020-09-02 22:05:48 +00:00
|
|
|
/*
|
|
|
|
** Axios-based Authentication
|
|
|
|
** See https://auth.nuxtjs.org/schemes/local.html#options
|
|
|
|
*/
|
|
|
|
auth: {
|
2020-09-03 14:50:23 +00:00
|
|
|
redirect: {
|
|
|
|
login: '/login',
|
|
|
|
logout: '/login',
|
|
|
|
callback: false,
|
|
|
|
home: '/'
|
|
|
|
},
|
2020-09-02 22:05:48 +00:00
|
|
|
strategies: {
|
2020-11-08 22:08:03 +00:00
|
|
|
jellyfin: {
|
|
|
|
_scheme: '~/schemes/jellyfinScheme'
|
2020-09-02 22:05:48 +00:00
|
|
|
}
|
2021-01-19 05:02:28 +00:00
|
|
|
},
|
|
|
|
cookie: {
|
|
|
|
prefix: 'auth.',
|
|
|
|
options: {
|
|
|
|
path: '/'
|
|
|
|
}
|
2020-11-08 22:08:03 +00:00
|
|
|
}
|
2020-09-02 22:05:48 +00:00
|
|
|
},
|
2020-09-05 21:27:26 +00:00
|
|
|
i18n: {
|
|
|
|
locales: [
|
2020-09-18 22:26:47 +00:00
|
|
|
{ code: 'cs', iso: 'cs-CZ', name: 'Čeština', file: 'cs.json' },
|
|
|
|
{ code: 'de', iso: 'de-DE', name: 'Deutsch', file: 'de.json' },
|
2021-01-24 14:14:51 +00:00
|
|
|
{ code: 'enUS', iso: 'en-US', name: 'English', file: 'en-US.json' },
|
2020-10-15 22:21:47 +00:00
|
|
|
{ code: 'es', iso: 'es-ES', name: 'Español (España)', file: 'es.json' },
|
2020-09-07 21:25:01 +00:00
|
|
|
{ code: 'fr', iso: 'fr-FR', name: 'Français', file: 'fr-FR.json' },
|
2021-01-15 15:25:08 +00:00
|
|
|
{ code: 'nb', iso: 'nb-NO', name: 'Norsk', file: 'nb_NO.json' },
|
2020-09-18 22:26:47 +00:00
|
|
|
{ code: 'nl', iso: 'nl-NL', name: 'Nederlands', file: 'nl.json' },
|
2020-09-17 21:47:29 +00:00
|
|
|
{ code: 'pl', iso: 'pl-PL', name: 'Polski', file: 'pl.json' },
|
2020-09-07 21:25:01 +00:00
|
|
|
{ code: 'ro', iso: 'ro-RO', name: 'Română', file: 'ro.json' },
|
2020-09-17 21:47:29 +00:00
|
|
|
{ code: 'sk', iso: 'sk-SK', name: 'Slovenčina', file: 'sk.json' },
|
2020-09-07 21:25:01 +00:00
|
|
|
{ code: 'sl', iso: 'sl-SI', name: 'Slovenščina', file: 'sl.json' },
|
|
|
|
{ code: 'sv', iso: 'sv-SE', name: 'Svenska', file: 'sv.json' },
|
2020-09-17 21:47:29 +00:00
|
|
|
{ code: 'ta', iso: 'ta-IN', name: 'தமிழ்', file: 'ta.json' },
|
|
|
|
{ code: 'tr', iso: 'tr-TR', name: 'Türkçe', file: 'tr.json' },
|
2020-10-04 08:37:43 +00:00
|
|
|
{ code: 'vi', iso: 'vi-VN', name: 'Tiếng Việt', file: 'vi.json' },
|
2021-01-24 14:14:51 +00:00
|
|
|
{ code: 'zhCN', iso: 'zh_Hans', name: '简体中文', file: 'zh_Hans.json' }
|
2020-09-05 21:27:26 +00:00
|
|
|
],
|
|
|
|
lazy: true,
|
|
|
|
langDir: 'locales/',
|
2020-11-14 22:26:18 +00:00
|
|
|
strategy: 'no_prefix',
|
2021-01-24 14:14:51 +00:00
|
|
|
defaultLocale: 'enUS',
|
2020-11-14 22:26:18 +00:00
|
|
|
vueI18n: {
|
2021-01-24 14:14:51 +00:00
|
|
|
fallbackLocale: 'enUS'
|
2021-01-04 17:08:23 +00:00
|
|
|
}
|
2020-09-05 21:27:26 +00:00
|
|
|
},
|
2020-12-10 08:35:09 +00:00
|
|
|
dateFns: {
|
2020-12-17 23:04:02 +00:00
|
|
|
locales: [
|
|
|
|
'cs',
|
|
|
|
'de',
|
|
|
|
'enUS',
|
|
|
|
'es',
|
|
|
|
'fr',
|
|
|
|
'nb',
|
|
|
|
'nl',
|
|
|
|
'pl',
|
|
|
|
'ro',
|
|
|
|
'sk',
|
|
|
|
'sl',
|
|
|
|
'sv',
|
|
|
|
'ta',
|
|
|
|
'tr',
|
|
|
|
'vi',
|
|
|
|
'zhCN'
|
|
|
|
],
|
|
|
|
defaultLocale: 'enUS'
|
2020-12-10 08:35:09 +00:00
|
|
|
},
|
2020-09-02 18:34:50 +00:00
|
|
|
/*
|
|
|
|
** vuetify module configuration
|
|
|
|
** https://github.com/nuxt-community/vuetify-module
|
|
|
|
*/
|
|
|
|
vuetify: {
|
|
|
|
customVariables: ['~/assets/variables.scss'],
|
2020-10-22 17:17:15 +00:00
|
|
|
treeShake: true,
|
2020-09-03 15:24:56 +00:00
|
|
|
defaultAssets: false,
|
2020-09-02 18:34:50 +00:00
|
|
|
theme: {
|
2020-09-03 17:43:23 +00:00
|
|
|
dark: true,
|
2020-09-21 09:52:38 +00:00
|
|
|
default: 'dark',
|
|
|
|
disable: false,
|
2020-09-03 17:43:23 +00:00
|
|
|
themes: {
|
|
|
|
dark: {
|
2020-12-15 16:57:56 +00:00
|
|
|
primary: '#0086b3',
|
|
|
|
secondary: '#2f3951',
|
2020-09-21 09:52:38 +00:00
|
|
|
accent: '#FF4081',
|
2020-12-19 21:11:55 +00:00
|
|
|
info: '#0099CC',
|
2020-09-21 09:52:38 +00:00
|
|
|
warning: '#FB8C00',
|
|
|
|
error: '#FF5252',
|
2020-09-25 20:16:11 +00:00
|
|
|
success: '#4CAF50',
|
2020-12-15 16:57:56 +00:00
|
|
|
background: '#14141F',
|
|
|
|
track: '#1c2331',
|
|
|
|
thumb: '#252e41'
|
2020-09-10 18:33:48 +00:00
|
|
|
},
|
|
|
|
light: {
|
2020-09-21 09:52:38 +00:00
|
|
|
primary: '#00A4DC',
|
|
|
|
secondary: '#424242',
|
|
|
|
accent: '#FF4081',
|
2020-12-19 21:11:55 +00:00
|
|
|
info: '#33b5e5',
|
2020-09-21 09:52:38 +00:00
|
|
|
warning: '#FB8C00',
|
|
|
|
error: '#FF5252',
|
2020-09-25 20:16:11 +00:00
|
|
|
success: '#4CAF50',
|
2020-11-05 23:15:34 +00:00
|
|
|
background: '#f2f2f2',
|
|
|
|
track: '#FFFFFF',
|
|
|
|
thumb: '#000000'
|
2020-09-03 17:43:23 +00:00
|
|
|
}
|
|
|
|
},
|
|
|
|
options: {
|
|
|
|
customProperties: true
|
|
|
|
}
|
2020-09-02 18:34:50 +00:00
|
|
|
}
|
|
|
|
},
|
2021-01-27 14:29:10 +00:00
|
|
|
loadingIndicator: {
|
|
|
|
name: 'circle',
|
|
|
|
color: '#0086b3',
|
|
|
|
background: '#14141F'
|
|
|
|
},
|
2020-09-02 18:34:50 +00:00
|
|
|
/*
|
|
|
|
** Build configuration
|
|
|
|
** See https://nuxtjs.org/api/configuration-build/
|
|
|
|
*/
|
2020-09-17 12:05:36 +00:00
|
|
|
build: {
|
2020-11-16 19:16:39 +00:00
|
|
|
// @ts-ignore -- Undocumented options
|
|
|
|
loadingScreen: {
|
|
|
|
image: 'icon.png',
|
|
|
|
colors: {
|
|
|
|
client: '#00A4DC',
|
2021-01-19 04:39:07 +00:00
|
|
|
modern: '#aa5cc3',
|
|
|
|
server: '#424242'
|
2020-11-16 19:16:39 +00:00
|
|
|
}
|
|
|
|
},
|
2020-09-17 12:05:36 +00:00
|
|
|
babel: {
|
|
|
|
// envName: server, client, modern
|
2020-12-16 23:57:19 +00:00
|
|
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
2020-11-15 14:30:10 +00:00
|
|
|
presets(): any {
|
2020-09-17 12:05:36 +00:00
|
|
|
return [
|
|
|
|
[
|
|
|
|
'@nuxt/babel-preset-app',
|
|
|
|
{
|
|
|
|
corejs: { version: 3 }
|
|
|
|
}
|
|
|
|
]
|
|
|
|
];
|
|
|
|
}
|
2020-10-19 22:14:55 +00:00
|
|
|
},
|
2020-12-09 18:08:03 +00:00
|
|
|
extend(
|
|
|
|
config: webpack.Configuration,
|
|
|
|
{ isClient }: { isClient: boolean }
|
|
|
|
): void {
|
2020-10-19 22:14:55 +00:00
|
|
|
if (isClient) {
|
2020-12-09 16:18:24 +00:00
|
|
|
// Web Worker support
|
2020-12-09 18:08:03 +00:00
|
|
|
config.module?.rules.push({
|
2020-12-09 16:18:24 +00:00
|
|
|
test: /\.worker\.(js|ts)$/i,
|
|
|
|
use: [
|
|
|
|
{
|
|
|
|
loader: 'comlink-loader',
|
|
|
|
options: {
|
|
|
|
singleton: true
|
|
|
|
}
|
|
|
|
}
|
|
|
|
]
|
|
|
|
});
|
2020-10-19 22:14:55 +00:00
|
|
|
}
|
2020-11-15 14:00:39 +00:00
|
|
|
},
|
2020-12-15 10:23:13 +00:00
|
|
|
transpile: ['@nuxtjs/auth', 'vee-validate/dist/rules']
|
2020-09-17 12:05:36 +00:00
|
|
|
},
|
2020-09-04 11:11:21 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Host set to 0.0.0.0 in order to access the dev server on the LAN
|
|
|
|
*/
|
|
|
|
server: {
|
|
|
|
host: '0.0.0.0'
|
|
|
|
}
|
2020-09-02 18:34:50 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
export default config;
|