2021-08-18 00:01:11 +02:00
|
|
|
const pkg = require('./package.json')
|
|
|
|
|
2024-10-12 10:46:44 +02:00
|
|
|
const routerBasePath = process.env.ROUTER_BASE_PATH || ''
|
2024-10-14 12:12:10 +02:00
|
|
|
const serverHostUrl = process.env.NODE_ENV === 'production' ? '' : 'http://localhost:3333'
|
2024-10-17 10:25:57 +02:00
|
|
|
const serverPaths = ['api/', 'public/', 'hls/', 'auth/', 'feed/', 'status', 'login', 'logout', 'init']
|
|
|
|
const proxy = Object.fromEntries(serverPaths.map((path) => [`${routerBasePath}/${path}`, { target: process.env.NODE_ENV !== 'production' ? serverHostUrl : '/' }]))
|
2024-10-12 10:46:44 +02:00
|
|
|
|
2021-08-18 00:01:11 +02:00
|
|
|
module.exports = {
|
|
|
|
// Disable server-side rendering: https://go.nuxtjs.dev/ssr-mode
|
|
|
|
ssr: false,
|
|
|
|
target: 'static',
|
|
|
|
dev: process.env.NODE_ENV !== 'production',
|
|
|
|
env: {
|
2024-10-14 12:12:10 +02:00
|
|
|
serverUrl: serverHostUrl + routerBasePath,
|
2022-03-02 00:59:47 +01:00
|
|
|
chromecastReceiver: 'FD1F76C5'
|
2021-08-18 00:01:11 +02:00
|
|
|
},
|
|
|
|
telemetry: false,
|
|
|
|
|
|
|
|
publicRuntimeConfig: {
|
2022-10-01 23:07:30 +02:00
|
|
|
version: pkg.version,
|
2024-10-12 10:46:44 +02:00
|
|
|
routerBasePath
|
2021-08-18 00:01:11 +02:00
|
|
|
},
|
|
|
|
|
|
|
|
// Global page headers: https://go.nuxtjs.dev/config-head
|
|
|
|
head: {
|
2021-10-17 03:33:49 +02:00
|
|
|
title: 'Audiobookshelf',
|
2021-08-18 00:01:11 +02:00
|
|
|
htmlAttrs: {
|
|
|
|
lang: 'en'
|
|
|
|
},
|
2024-10-17 00:42:00 +02:00
|
|
|
meta: [{ charset: 'utf-8' }, { name: 'viewport', content: 'width=device-width, initial-scale=1' }, { hid: 'description', name: 'description', content: '' }, { hid: 'robots', name: 'robots', content: 'noindex' }],
|
2023-05-01 23:24:31 +02:00
|
|
|
script: [],
|
2021-08-18 00:01:11 +02:00
|
|
|
link: [
|
2024-10-12 10:46:44 +02:00
|
|
|
{ rel: 'icon', type: 'image/x-icon', href: routerBasePath + '/favicon.ico' },
|
|
|
|
{ rel: 'apple-touch-icon', href: routerBasePath + '/ios_icon.png' }
|
2021-08-18 00:01:11 +02:00
|
|
|
]
|
|
|
|
},
|
|
|
|
|
2022-10-01 23:07:30 +02:00
|
|
|
router: {
|
2024-10-12 10:46:44 +02:00
|
|
|
base: routerBasePath
|
2022-10-01 23:07:30 +02:00
|
|
|
},
|
2021-09-29 00:36:41 +02:00
|
|
|
|
2021-08-18 00:01:11 +02:00
|
|
|
// Global CSS: https://go.nuxtjs.dev/config-css
|
2024-10-17 00:42:00 +02:00
|
|
|
css: ['@/assets/tailwind.css', '@/assets/app.css'],
|
2021-08-18 00:01:11 +02:00
|
|
|
|
|
|
|
// Plugins to run before rendering page: https://go.nuxtjs.dev/config-plugins
|
2024-10-17 00:42:00 +02:00
|
|
|
plugins: ['@/plugins/constants.js', '@/plugins/init.client.js', '@/plugins/axios.js', '@/plugins/toast.js', '@/plugins/utils.js', '@/plugins/i18n.js'],
|
2021-08-18 00:01:11 +02:00
|
|
|
|
|
|
|
// Auto import components: https://go.nuxtjs.dev/config-components
|
|
|
|
components: true,
|
|
|
|
|
|
|
|
// Modules for dev and build (recommended): https://go.nuxtjs.dev/config-modules
|
|
|
|
buildModules: [
|
|
|
|
// https://go.nuxtjs.dev/tailwindcss
|
2024-01-20 00:54:41 +01:00
|
|
|
'@nuxtjs/pwa'
|
2021-08-18 00:01:11 +02:00
|
|
|
],
|
|
|
|
|
|
|
|
// Modules: https://go.nuxtjs.dev/config-modules
|
2024-10-17 00:42:00 +02:00
|
|
|
modules: ['nuxt-socket-io', '@nuxtjs/axios', '@nuxtjs/proxy'],
|
2021-08-18 00:01:11 +02:00
|
|
|
|
2024-10-17 10:25:57 +02:00
|
|
|
proxy,
|
2021-08-18 00:01:11 +02:00
|
|
|
|
|
|
|
io: {
|
2024-10-17 00:42:00 +02:00
|
|
|
sockets: [
|
|
|
|
{
|
|
|
|
name: 'dev',
|
|
|
|
url: serverHostUrl
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'prod'
|
|
|
|
}
|
|
|
|
]
|
2021-08-18 00:01:11 +02:00
|
|
|
},
|
|
|
|
|
|
|
|
// Axios module configuration: https://go.nuxtjs.dev/config-axios
|
|
|
|
axios: {
|
2024-10-12 10:46:44 +02:00
|
|
|
baseURL: routerBasePath
|
2021-08-18 00:01:11 +02:00
|
|
|
},
|
|
|
|
|
2022-02-09 02:09:24 +01:00
|
|
|
// nuxt/pwa https://pwa.nuxtjs.org
|
|
|
|
pwa: {
|
2022-02-09 15:57:34 +01:00
|
|
|
icon: false,
|
2022-02-09 02:09:24 +01:00
|
|
|
meta: {
|
2022-02-09 15:57:34 +01:00
|
|
|
appleStatusBarStyle: 'black',
|
2022-02-09 02:09:24 +01:00
|
|
|
name: 'Audiobookshelf',
|
2024-02-16 09:15:27 +01:00
|
|
|
theme_color: '#232323',
|
2022-02-09 15:57:34 +01:00
|
|
|
mobileAppIOS: true,
|
|
|
|
nativeUI: true
|
2022-02-09 02:09:24 +01:00
|
|
|
},
|
|
|
|
manifest: {
|
|
|
|
name: 'Audiobookshelf',
|
|
|
|
short_name: 'Audiobookshelf',
|
2022-02-09 15:57:34 +01:00
|
|
|
display: 'standalone',
|
2024-02-16 09:15:27 +01:00
|
|
|
background_color: '#232323',
|
2022-02-09 15:57:34 +01:00
|
|
|
icons: [
|
|
|
|
{
|
2024-10-12 10:46:44 +02:00
|
|
|
src: routerBasePath + '/icon.svg',
|
2024-01-28 23:00:26 +01:00
|
|
|
sizes: 'any'
|
|
|
|
},
|
|
|
|
{
|
2024-10-12 10:46:44 +02:00
|
|
|
src: routerBasePath + '/icon192.png',
|
2024-01-28 23:00:26 +01:00
|
|
|
type: 'image/png',
|
|
|
|
sizes: 'any'
|
2022-02-09 15:57:34 +01:00
|
|
|
}
|
|
|
|
]
|
2022-06-29 15:11:03 +02:00
|
|
|
},
|
|
|
|
workbox: {
|
2022-12-02 00:26:22 +01:00
|
|
|
offline: false,
|
|
|
|
cacheAssets: false,
|
2022-11-20 00:57:26 +01:00
|
|
|
preCaching: [],
|
|
|
|
runtimeCaching: []
|
2022-02-09 15:57:34 +01:00
|
|
|
}
|
2022-02-09 02:09:24 +01:00
|
|
|
},
|
|
|
|
|
2021-08-18 00:01:11 +02:00
|
|
|
// Build Configuration: https://go.nuxtjs.dev/config-build
|
2022-06-26 18:15:19 +02:00
|
|
|
build: {
|
|
|
|
postcss: {
|
2024-09-16 00:29:23 +02:00
|
|
|
postcssOptions: {
|
|
|
|
plugins: {
|
|
|
|
tailwindcss: {},
|
2024-10-17 00:42:00 +02:00
|
|
|
autoprefixer: {}
|
2024-09-16 00:29:23 +02:00
|
|
|
}
|
|
|
|
}
|
2022-06-26 18:15:19 +02:00
|
|
|
}
|
|
|
|
},
|
2021-08-18 00:01:11 +02:00
|
|
|
watchers: {
|
|
|
|
webpack: {
|
|
|
|
aggregateTimeout: 300,
|
|
|
|
poll: 1000
|
|
|
|
}
|
|
|
|
},
|
|
|
|
server: {
|
|
|
|
port: process.env.NODE_ENV === 'production' ? 80 : 3000,
|
2022-04-12 13:57:45 +02:00
|
|
|
host: '0.0.0.0'
|
2022-06-26 18:15:19 +02:00
|
|
|
},
|
|
|
|
|
|
|
|
/**
|
2024-10-17 00:42:00 +02:00
|
|
|
* Temporary workaround for @nuxt-community/tailwindcss-module.
|
|
|
|
*
|
|
|
|
* Reported: 2022-05-23
|
|
|
|
* See: [Issue tracker](https://github.com/nuxt-community/tailwindcss-module/issues/480)
|
|
|
|
*/
|
2022-06-26 18:15:19 +02:00
|
|
|
devServerHandlers: [],
|
2024-04-15 22:57:21 +02:00
|
|
|
|
2024-10-17 00:42:00 +02:00
|
|
|
ignore: ['**/*.test.*', '**/*.cy.*']
|
2021-08-18 00:01:11 +02:00
|
|
|
}
|