2021-08-18 00:01:11 +02:00
|
|
|
const pkg = require('./package.json')
|
|
|
|
|
|
|
|
module.exports = {
|
|
|
|
// Disable server-side rendering: https://go.nuxtjs.dev/ssr-mode
|
|
|
|
ssr: false,
|
|
|
|
target: 'static',
|
|
|
|
dev: process.env.NODE_ENV !== 'production',
|
|
|
|
env: {
|
|
|
|
serverUrl: process.env.NODE_ENV === 'production' ? '' : 'http://localhost:3333',
|
|
|
|
// serverUrl: '',
|
|
|
|
baseUrl: process.env.BASE_URL || 'http://0.0.0.0'
|
|
|
|
},
|
|
|
|
// rootDir: process.env.NODE_ENV !== 'production' ? 'client/' : '',
|
|
|
|
telemetry: false,
|
|
|
|
|
|
|
|
publicRuntimeConfig: {
|
|
|
|
version: pkg.version
|
|
|
|
},
|
|
|
|
|
|
|
|
// 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'
|
|
|
|
},
|
|
|
|
meta: [
|
|
|
|
{ charset: 'utf-8' },
|
|
|
|
{ name: 'viewport', content: 'width=device-width, initial-scale=1' },
|
|
|
|
{ hid: 'description', name: 'description', content: '' }
|
|
|
|
],
|
|
|
|
script: [
|
|
|
|
{
|
2022-02-18 00:39:38 +01:00
|
|
|
src: '/libs/sortable.js'
|
2021-08-18 00:01:11 +02:00
|
|
|
}
|
|
|
|
],
|
|
|
|
link: [
|
|
|
|
{ rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' },
|
2021-10-17 14:09:40 +02:00
|
|
|
{ rel: 'stylesheet', href: 'https://fonts.googleapis.com/css2?family=Ubuntu+Mono&family=Source+Sans+Pro:wght@300;400;600' },
|
2021-08-18 00:01:11 +02:00
|
|
|
]
|
|
|
|
},
|
|
|
|
|
2021-09-29 00:36:41 +02:00
|
|
|
router: {
|
|
|
|
middleware: ['routed']
|
|
|
|
},
|
|
|
|
|
2021-08-18 00:01:11 +02:00
|
|
|
// Global CSS: https://go.nuxtjs.dev/config-css
|
|
|
|
css: [
|
|
|
|
'@/assets/app.css'
|
|
|
|
],
|
|
|
|
|
|
|
|
// Plugins to run before rendering page: https://go.nuxtjs.dev/config-plugins
|
|
|
|
plugins: [
|
2022-02-18 00:39:38 +01:00
|
|
|
// '@/plugins/chromecast.client.js',
|
2021-09-15 03:45:00 +02:00
|
|
|
'@/plugins/constants.js',
|
2021-08-18 00:01:11 +02:00
|
|
|
'@/plugins/init.client.js',
|
|
|
|
'@/plugins/axios.js',
|
|
|
|
'@/plugins/toast.js'
|
|
|
|
],
|
|
|
|
|
|
|
|
// 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
|
|
|
|
'@nuxtjs/tailwindcss',
|
2022-02-09 02:09:24 +01:00
|
|
|
'@nuxtjs/pwa'
|
2021-08-18 00:01:11 +02:00
|
|
|
],
|
|
|
|
|
|
|
|
// Modules: https://go.nuxtjs.dev/config-modules
|
|
|
|
modules: [
|
|
|
|
'nuxt-socket-io',
|
|
|
|
'@nuxtjs/axios',
|
|
|
|
'@nuxtjs/proxy'
|
|
|
|
],
|
|
|
|
|
|
|
|
proxy: {
|
2021-08-21 20:02:24 +02:00
|
|
|
'/dev/': { target: 'http://localhost:3333', pathRewrite: { '^/dev/': '' } },
|
2021-10-05 05:11:42 +02:00
|
|
|
'/local/': { target: process.env.NODE_ENV !== 'production' ? 'http://localhost:3333' : '/' },
|
|
|
|
'/lib/': { target: process.env.NODE_ENV !== 'production' ? 'http://localhost:3333' : '/' },
|
2021-10-09 00:30:20 +02:00
|
|
|
'/ebook/': { target: process.env.NODE_ENV !== 'production' ? 'http://localhost:3333' : '/' },
|
2021-10-05 05:11:42 +02:00
|
|
|
'/s/': { target: process.env.NODE_ENV !== 'production' ? 'http://localhost:3333' : '/' },
|
2021-09-22 03:57:33 +02:00
|
|
|
'/metadata/': { target: process.env.NODE_ENV !== 'production' ? 'http://localhost:3333' : '/' }
|
2021-08-18 00:01:11 +02:00
|
|
|
},
|
|
|
|
|
|
|
|
io: {
|
|
|
|
sockets: [{
|
|
|
|
name: 'dev',
|
|
|
|
url: 'http://localhost:3333'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'prod'
|
|
|
|
}]
|
|
|
|
},
|
|
|
|
|
|
|
|
// Axios module configuration: https://go.nuxtjs.dev/config-axios
|
|
|
|
axios: {
|
|
|
|
baseURL: process.env.serverUrl || ''
|
|
|
|
},
|
|
|
|
|
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',
|
2022-02-09 15:57:34 +01:00
|
|
|
theme_color: '#373838',
|
|
|
|
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',
|
|
|
|
background_color: '#373838',
|
|
|
|
icons: [
|
|
|
|
{
|
|
|
|
src: '/icon64.png',
|
|
|
|
sizes: "64x64"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
src: '/icon192.png',
|
2022-02-09 19:15:36 +01:00
|
|
|
sizes: "192x192"
|
2022-02-09 15:57:34 +01:00
|
|
|
},
|
|
|
|
{
|
|
|
|
src: '/Logo.png',
|
2022-02-09 19:15:36 +01:00
|
|
|
sizes: "512x512"
|
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
|
2021-10-17 03:33:49 +02:00
|
|
|
build: {},
|
2021-08-18 00:01:11 +02:00
|
|
|
watchers: {
|
|
|
|
webpack: {
|
|
|
|
aggregateTimeout: 300,
|
|
|
|
poll: 1000
|
|
|
|
}
|
|
|
|
},
|
|
|
|
server: {
|
|
|
|
port: process.env.NODE_ENV === 'production' ? 80 : 3000,
|
|
|
|
host: process.env.NODE_ENV === 'production' ? '0.0.0.0' : 'localhost'
|
|
|
|
}
|
|
|
|
}
|