mirror of
https://github.com/mealie-recipes/mealie.git
synced 2026-04-18 02:45:37 -04:00
Co-authored-by: Michael Genson <genson.michael@gmail.com> Co-authored-by: Michael Genson <71845777+michael-genson@users.noreply.github.com>
274 lines
9.1 KiB
TypeScript
274 lines
9.1 KiB
TypeScript
import { defineNuxtConfig } from "nuxt/config";
|
|
|
|
const AUTH_TOKEN = "mealie.access_token";
|
|
|
|
export default defineNuxtConfig({
|
|
// Global page headers: https://go.nuxtjs.dev/config-head
|
|
// target: "static",
|
|
|
|
modules: [
|
|
"@vite-pwa/nuxt",
|
|
"@nuxtjs/i18n",
|
|
"@nuxt/fonts",
|
|
"vuetify-nuxt-module",
|
|
"@nuxt/eslint",
|
|
],
|
|
ssr: false,
|
|
|
|
components: [
|
|
{
|
|
path: "~/components",
|
|
pathPrefix: false,
|
|
},
|
|
],
|
|
devtools: {
|
|
enabled: false,
|
|
},
|
|
|
|
app: {
|
|
baseURL: process.env.SUB_PATH || "/",
|
|
|
|
head: {
|
|
title: "Mealie",
|
|
meta: [
|
|
{ property: "og:type", content: "website" },
|
|
{ property: "og:title", content: "Mealie" },
|
|
{ property: "og:site_name", content: "Mealie" },
|
|
{
|
|
property: "og:description",
|
|
content: "Mealie is a recipe management app for your kitchen.",
|
|
},
|
|
{
|
|
property: "og:image",
|
|
content:
|
|
"https://raw.githubusercontent.com/mealie-recipes/mealie/9571816ac4eed5beacfc0abf6c03eff1427fd0eb/frontend/static/icons/android-chrome-512x512.png",
|
|
},
|
|
{ charset: "utf-8" },
|
|
{ name: "viewport", content: "width=device-width, initial-scale=1" },
|
|
{
|
|
name: "description",
|
|
content: "Mealie is a recipe management app for your kitchen.",
|
|
},
|
|
],
|
|
script: [
|
|
{
|
|
innerHTML: `(function(){try{var d=localStorage.getItem('vueuse-color-scheme');var m=d==='dark'||(d!=='light'&&matchMedia('(prefers-color-scheme:dark)').matches);document.documentElement.style.backgroundColor=m?'#1E1E1E':'#FFFFFF'}catch(e){}})()`,
|
|
type: "text/javascript",
|
|
},
|
|
],
|
|
link: [
|
|
{ rel: "icon", type: "image/x-icon", href: "/favicon.ico" },
|
|
{ rel: "shortcut icon", type: "image/png", href: "/icons/icon-x64.png" },
|
|
{ rel: "apple-touch-icon", type: "image/png", href: "/icons/apple-touch-icon.png" },
|
|
{ rel: "mask-icon", href: "/icons/safari-pinned-tab.svg" },
|
|
{ rel: "manifest", href: "/manifest.webmanifest", crossorigin: "use-credentials" },
|
|
],
|
|
},
|
|
|
|
/* viewTransition: {
|
|
name: "layout",
|
|
mode: "out-in",
|
|
}, */
|
|
viewTransition: true,
|
|
},
|
|
|
|
css: ["~/assets/main.css", "~/assets/style-overrides.scss"],
|
|
|
|
runtimeConfig: {
|
|
sessionPassword: process.env.SESSION_PASSWORD || "password-with-at-least-32-characters",
|
|
apiUrl: process.env.API_URL || "http://localhost:9000",
|
|
public: {
|
|
AUTH_TOKEN,
|
|
GLOBAL_MIDDLEWARE: process.env.GLOBAL_MIDDLEWARE || undefined,
|
|
SUB_PATH: process.env.SUB_PATH || "",
|
|
// ==============================================
|
|
// Theme Runtime Config
|
|
useDark: Boolean(process.env.THEME_USE_DARK) || false,
|
|
themes: {
|
|
dark: {
|
|
primary: process.env.THEME_DARK_PRIMARY || "#E58325",
|
|
accent: process.env.THEME_DARK_ACCENT || "#007A99",
|
|
secondary: process.env.THEME_DARK_SECONDARY || "#973542",
|
|
success: process.env.THEME_DARK_SUCCESS || "#43A047",
|
|
info: process.env.THEME_DARK_INFO || "#1976d2",
|
|
warning: process.env.THEME_DARK_WARNING || "#FF6D00",
|
|
error: process.env.THEME_DARK_ERROR || "#EF5350",
|
|
background: "#1E1E1E",
|
|
},
|
|
light: {
|
|
primary: process.env.THEME_LIGHT_PRIMARY || "#E58325",
|
|
accent: process.env.THEME_LIGHT_ACCENT || "#007A99",
|
|
secondary: process.env.THEME_LIGHT_SECONDARY || "#973542",
|
|
success: process.env.THEME_LIGHT_SUCCESS || "#43A047",
|
|
info: process.env.THEME_LIGHT_INFO || "#1976d2",
|
|
warning: process.env.THEME_LIGHT_WARNING || "#FF6D00",
|
|
error: process.env.THEME_LIGHT_ERROR || "#EF5350",
|
|
},
|
|
},
|
|
},
|
|
},
|
|
|
|
// Build Configuration: https://go.nuxtjs.dev/config-build
|
|
build: {
|
|
// https://nuxtjs.org/docs/2.x/configuration-glossary/configuration-build
|
|
analyze: false,
|
|
/* babel: {
|
|
plugins: [
|
|
["@babel/plugin-proposal-private-property-in-object", { loose: true }],
|
|
],
|
|
}, */
|
|
transpile: process.env.NODE_ENV !== "production" ? [/@vue[\\/]composition-api/] : [],
|
|
},
|
|
future: {
|
|
compatibilityVersion: 4,
|
|
},
|
|
|
|
compatibilityDate: "2026-04-08",
|
|
|
|
nitro: {
|
|
baseURL: process.env.SUB_PATH || "",
|
|
},
|
|
|
|
// eslint rules
|
|
eslint: {
|
|
config: {
|
|
formatters: true,
|
|
stylistic: {
|
|
indent: 2,
|
|
semi: true,
|
|
quotes: "double",
|
|
commaDangle: "always-multiline",
|
|
},
|
|
},
|
|
},
|
|
fonts: {
|
|
defaults: {
|
|
weights: ["100 900"],
|
|
styles: ["normal", "italic"],
|
|
subsets: ["cyrillic-ext", "cyrillic", "greek-ext", "greek", "vietnamese", "latin-ext", "latin"],
|
|
},
|
|
},
|
|
|
|
i18n: {
|
|
locales: [
|
|
// CODE_GEN_ID: MESSAGE_LOCALES
|
|
{ code: "af-ZA", file: "af-ZA.ts", dir: "ltr" },
|
|
{ code: "ar-SA", file: "ar-SA.ts", dir: "rtl" },
|
|
{ code: "bg-BG", file: "bg-BG.ts", dir: "ltr" },
|
|
{ code: "ca-ES", file: "ca-ES.ts", dir: "ltr" },
|
|
{ code: "cs-CZ", file: "cs-CZ.ts", dir: "ltr" },
|
|
{ code: "da-DK", file: "da-DK.ts", dir: "ltr" },
|
|
{ code: "de-DE", file: "de-DE.ts", dir: "ltr" },
|
|
{ code: "el-GR", file: "el-GR.ts", dir: "ltr" },
|
|
{ code: "en-GB", file: "en-GB.ts", dir: "ltr" },
|
|
{ code: "en-US", file: "en-US.ts", dir: "ltr" },
|
|
{ code: "es-ES", file: "es-ES.ts", dir: "ltr" },
|
|
{ code: "et-EE", file: "et-EE.ts", dir: "ltr" },
|
|
{ code: "fi-FI", file: "fi-FI.ts", dir: "ltr" },
|
|
{ code: "fr-BE", file: "fr-BE.ts", dir: "ltr" },
|
|
{ code: "fr-CA", file: "fr-CA.ts", dir: "ltr" },
|
|
{ code: "fr-FR", file: "fr-FR.ts", dir: "ltr" },
|
|
{ code: "gl-ES", file: "gl-ES.ts", dir: "ltr" },
|
|
{ code: "he-IL", file: "he-IL.ts", dir: "rtl" },
|
|
{ code: "hr-HR", file: "hr-HR.ts", dir: "ltr" },
|
|
{ code: "hu-HU", file: "hu-HU.ts", dir: "ltr" },
|
|
{ code: "is-IS", file: "is-IS.ts", dir: "ltr" },
|
|
{ code: "it-IT", file: "it-IT.ts", dir: "ltr" },
|
|
{ code: "ja-JP", file: "ja-JP.ts", dir: "ltr" },
|
|
{ code: "ko-KR", file: "ko-KR.ts", dir: "ltr" },
|
|
{ code: "lt-LT", file: "lt-LT.ts", dir: "ltr" },
|
|
{ code: "lv-LV", file: "lv-LV.ts", dir: "ltr" },
|
|
{ code: "nl-NL", file: "nl-NL.ts", dir: "ltr" },
|
|
{ code: "no-NO", file: "no-NO.ts", dir: "ltr" },
|
|
{ code: "pl-PL", file: "pl-PL.ts", dir: "ltr" },
|
|
{ code: "pt-BR", file: "pt-BR.ts", dir: "ltr" },
|
|
{ code: "pt-PT", file: "pt-PT.ts", dir: "ltr" },
|
|
{ code: "ro-RO", file: "ro-RO.ts", dir: "ltr" },
|
|
{ code: "ru-RU", file: "ru-RU.ts", dir: "ltr" },
|
|
{ code: "sk-SK", file: "sk-SK.ts", dir: "ltr" },
|
|
{ code: "sl-SI", file: "sl-SI.ts", dir: "ltr" },
|
|
{ code: "sr-SP", file: "sr-SP.ts", dir: "ltr" },
|
|
{ code: "sv-SE", file: "sv-SE.ts", dir: "ltr" },
|
|
{ code: "tr-TR", file: "tr-TR.ts", dir: "ltr" },
|
|
{ code: "uk-UA", file: "uk-UA.ts", dir: "ltr" },
|
|
{ code: "vi-VN", file: "vi-VN.ts", dir: "ltr" },
|
|
{ code: "zh-CN", file: "zh-CN.ts", dir: "ltr" },
|
|
{ code: "zh-TW", file: "zh-TW.ts", dir: "ltr" },
|
|
// END: MESSAGE_LOCALES
|
|
],
|
|
strategy: "no_prefix",
|
|
lazy: true,
|
|
types: "composition",
|
|
langDir: "./../app/lang/locales", // note: we need to up one ../ because the default root of lang dir is the /frontend/i18n, which can not be configured
|
|
defaultLocale: "en-US",
|
|
detectBrowserLanguage: {
|
|
useCookie: true,
|
|
alwaysRedirect: true,
|
|
fallbackLocale: "en-US",
|
|
},
|
|
compilation: {
|
|
strictMessage: false,
|
|
escapeHtml: true,
|
|
},
|
|
vueI18n: "./../app/i18n.config.ts", // note: we need to up one ../ because the default root of lang dir is the /frontend/i18n, which can not be configured
|
|
},
|
|
|
|
// PWA module configuration: https://vite-pwa-org.netlify.app/frameworks/nuxt.html
|
|
pwa: {
|
|
registerType: "autoUpdate",
|
|
devOptions: {
|
|
enabled: false,
|
|
suppressWarnings: true,
|
|
},
|
|
workbox: {
|
|
navigateFallback: "/",
|
|
navigateFallbackAllowlist: [/^(?!\/api|\/docs)/],
|
|
globPatterns: ["**/*.{js,css,html,png,svg,ico}"],
|
|
globIgnores: ["404.html", "200.html", "index.html"],
|
|
cleanupOutdatedCaches: true,
|
|
skipWaiting: true,
|
|
clientsClaim: true,
|
|
},
|
|
client: {
|
|
installPrompt: true,
|
|
periodicSyncForUpdates: 120,
|
|
},
|
|
includeAssets: ["favicon.ico", "apple-touch-icon.png", "safari-pinned-tab.svg"],
|
|
manifest: false, // This is served via the backend, see mealie/routes/spa/manifest.py
|
|
},
|
|
|
|
// Vuetify module configuration: https://go.nuxtjs.dev/config-vuetify
|
|
vuetify: {
|
|
moduleOptions: {},
|
|
vuetifyOptions: {
|
|
icons: {
|
|
defaultSet: "mdi-svg",
|
|
},
|
|
// Theme Config set at runtime by /plugins/theme.ts
|
|
// This config doesn't do anything.
|
|
theme: {},
|
|
locale: {
|
|
locale: "en-US",
|
|
fallback: "en-US",
|
|
},
|
|
defaults: {
|
|
VOverlay: {
|
|
scrollStrategy: "close",
|
|
},
|
|
VMenu: {
|
|
scrollStrategy: "close",
|
|
},
|
|
VAutocomplete: {
|
|
scrollStrategy: "close",
|
|
},
|
|
VCombobox: {
|
|
scrollStrategy: "close",
|
|
},
|
|
VSelect: {
|
|
scrollStrategy: "close",
|
|
},
|
|
},
|
|
},
|
|
},
|
|
});
|