mealie/frontend/nuxt.config.js

282 lines
8.7 KiB
JavaScript
Raw Normal View History

2021-07-31 22:00:28 +00:00
export default {
// Global page headers: https://go.nuxtjs.dev/config-head
head: {
titleTemplate: "%s - Mealie",
title: "Home",
2021-07-31 22:00:28 +00:00
meta: [
2021-08-02 03:24:47 +00:00
{ charset: "utf-8" },
{ name: "viewport", content: "width=device-width, initial-scale=1" },
{ hid: "description", name: "description", content: "" },
{ name: "format-detection", content: "telephone=no" },
2021-07-31 22:00:28 +00:00
],
2021-08-02 03:24:47 +00:00
link: [{ rel: "icon", type: "image/x-icon", href: "/favicon.ico" }],
},
2021-08-08 19:17:03 +00:00
env: {
GLOBAL_MIDDLEWARE: process.env.GLOBAL_MIDDLEWARE || null,
ALLOW_SIGNUP: process.env.ALLOW_SIGNUP || true,
},
router: {
base: process.env.SUB_PATH || "",
},
2021-08-02 03:24:47 +00:00
layoutTransition: {
name: "layout",
mode: "out-in",
2021-07-31 22:00:28 +00:00
},
// Global CSS: https://go.nuxtjs.dev/config-css
2021-08-02 03:24:47 +00:00
css: [{ src: "~/assets/main.css" }, { src: "~/assets/style-overrides.scss" }],
2021-07-31 22:00:28 +00:00
// Plugins to run before rendering page: https://go.nuxtjs.dev/config-plugins
plugins: ["~/plugins/globals.ts"],
2021-07-31 22:00:28 +00: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/typescript
2021-08-02 03:24:47 +00:00
"@nuxt/typescript-build",
2021-07-31 22:00:28 +00:00
// https://go.nuxtjs.dev/vuetify
2021-08-02 03:24:47 +00:00
"@nuxtjs/vuetify",
// https://composition-api.nuxtjs.org/getting-started/setup
"@nuxtjs/composition-api/module",
2021-08-09 01:01:45 +00:00
// https://vite.nuxtjs.org/getting-started/installation
"nuxt-vite",
2021-08-21 19:00:42 +00:00
// https://github.com/antfu/vue2-script-setup-transform
"vue2-script-setup-transform/nuxt",
2021-07-31 22:00:28 +00:00
],
// Modules: https://go.nuxtjs.dev/config-modules
modules: [
// https://go.nuxtjs.dev/axios
2021-08-02 03:24:47 +00:00
"@nuxtjs/axios",
2021-07-31 22:00:28 +00:00
// https://go.nuxtjs.dev/pwa
2021-08-02 03:24:47 +00:00
"@nuxtjs/pwa",
// https://i18n.nuxtjs.org/setup
"@nuxtjs/i18n",
2021-08-02 03:24:47 +00:00
// https://auth.nuxtjs.org/guide/setup
"@nuxtjs/auth-next",
// https://github.com/nuxt-community/proxy-module
2021-08-08 19:17:03 +00:00
[
"@nuxtjs/proxy",
{
logProvider: () => {
const provider = {
log: console.log,
debug: console.log,
info: console.info,
warn: console.warn,
error: console.error,
};
return provider;
},
logLevel: "debug",
},
],
2021-07-31 22:00:28 +00:00
],
2021-08-02 03:24:47 +00:00
auth: {
redirect: {
login: "/login",
logout: "/login",
2021-08-02 03:24:47 +00:00
callback: "/login",
home: "/",
},
// Options
strategies: {
local: {
2021-08-08 19:17:03 +00:00
resetOnError: true,
2021-08-02 03:24:47 +00:00
token: {
property: "access_token",
global: true,
// required: true,
// type: 'Bearer'
},
user: {
property: "",
autoFetch: true,
},
endpoints: {
login: {
2021-08-08 19:17:03 +00:00
url: "api/auth/token",
2021-08-02 03:24:47 +00:00
method: "post",
propertyName: "access_token",
},
2021-08-08 19:17:03 +00:00
refresh: { url: "api/auth/refresh", method: "post" },
user: { url: "api/users/self", method: "get" },
2021-08-02 03:24:47 +00:00
},
},
},
},
i18n: {
locales: [
2021-08-07 19:28:20 +00:00
// Auto Generated from "generate_nuxt_locales.py"
{ code: "el-GR", file: "el-GR.json" },
{ code: "it-IT", file: "it-IT.json" },
{ code: "ko-KR", file: "ko-KR.json" },
{ code: "es-ES", file: "es-ES.json" },
{ code: "ja-JP", file: "ja-JP.json" },
{ code: "zh-CN", file: "zh-CN.json" },
{ code: "tr-TR", file: "tr-TR.json" },
{ code: "ar-SA", file: "ar-SA.json" },
{ code: "hu-HU", file: "hu-HU.json" },
{ code: "pt-PT", file: "pt-PT.json" },
{ code: "no-NO", file: "no-NO.json" },
{ code: "sv-SE", file: "sv-SE.json" },
{ code: "ro-RO", file: "ro-RO.json" },
{ code: "uk-UA", file: "uk-UA.json" },
{ code: "pl-PL", file: "pl-PL.json" },
{ code: "da-DK", file: "da-DK.json" },
{ code: "pt-BR", file: "pt-BR.json" },
{ code: "de-DE", file: "de-DE.json" },
{ code: "ca-ES", file: "ca-ES.json" },
{ code: "sr-SP", file: "sr-SP.json" },
{ code: "cs-CZ", file: "cs-CZ.json" },
{ code: "fr-FR", file: "fr-FR.json" },
{ code: "zh-TW", file: "zh-TW.json" },
{ code: "af-ZA", file: "af-ZA.json" },
{ code: "ru-RU", file: "ru-RU.json" },
{ code: "he-IL", file: "he-IL.json" },
{ code: "nl-NL", file: "nl-NL.json" },
{ code: "en-US", file: "en-US.json" },
{ code: "en-GB", file: "en-GB.json" },
{ code: "fi-FI", file: "fi-FI.json" },
{ code: "vi-VN", file: "vi-VN.json" },
2021-08-02 03:24:47 +00:00
],
lazy: true,
langDir: "lang/messages",
defaultLocale: "en-US",
2021-08-07 19:28:20 +00:00
vueI18n: {
dateTimeFormats: {
// Auto Generated from "generate_nuxt_locales.py"
"el-GR": require("./lang/dateTimeFormats/el-GR.json"),
"it-IT": require("./lang/dateTimeFormats/it-IT.json"),
"ko-KR": require("./lang/dateTimeFormats/ko-KR.json"),
"es-ES": require("./lang/dateTimeFormats/es-ES.json"),
"ja-JP": require("./lang/dateTimeFormats/ja-JP.json"),
"zh-CN": require("./lang/dateTimeFormats/zh-CN.json"),
"tr-TR": require("./lang/dateTimeFormats/tr-TR.json"),
"ar-SA": require("./lang/dateTimeFormats/ar-SA.json"),
"hu-HU": require("./lang/dateTimeFormats/hu-HU.json"),
"pt-PT": require("./lang/dateTimeFormats/pt-PT.json"),
"no-NO": require("./lang/dateTimeFormats/no-NO.json"),
"sv-SE": require("./lang/dateTimeFormats/sv-SE.json"),
"ro-RO": require("./lang/dateTimeFormats/ro-RO.json"),
"uk-UA": require("./lang/dateTimeFormats/uk-UA.json"),
"pl-PL": require("./lang/dateTimeFormats/pl-PL.json"),
"da-DK": require("./lang/dateTimeFormats/da-DK.json"),
"pt-BR": require("./lang/dateTimeFormats/pt-BR.json"),
"de-DE": require("./lang/dateTimeFormats/de-DE.json"),
"ca-ES": require("./lang/dateTimeFormats/ca-ES.json"),
"sr-SP": require("./lang/dateTimeFormats/sr-SP.json"),
"cs-CZ": require("./lang/dateTimeFormats/cs-CZ.json"),
"fr-FR": require("./lang/dateTimeFormats/fr-FR.json"),
"zh-TW": require("./lang/dateTimeFormats/zh-TW.json"),
"af-ZA": require("./lang/dateTimeFormats/af-ZA.json"),
"ru-RU": require("./lang/dateTimeFormats/ru-RU.json"),
"he-IL": require("./lang/dateTimeFormats/he-IL.json"),
"nl-NL": require("./lang/dateTimeFormats/nl-NL.json"),
"en-US": require("./lang/dateTimeFormats/en-US.json"),
"en-GB": require("./lang/dateTimeFormats/en-GB.json"),
"fi-FI": require("./lang/dateTimeFormats/fi-FI.json"),
"vi-VN": require("./lang/dateTimeFormats/vi-VN.json"),
},
},
fallbackLocale: "es",
2021-08-02 03:24:47 +00:00
},
2021-07-31 22:00:28 +00:00
// Axios module configuration: https://go.nuxtjs.dev/config-axios
2021-08-08 04:21:44 +00:00
axios: {
proxy: true,
},
2021-08-08 19:17:03 +00:00
publicRuntimeConfig: {
GLOBAL_MIDDLEWARE: process.env.GLOBAL_MIDDLEWARE || null,
ALLOW_SIGNUP: process.env.ALLOW_SIGNUP || true,
2021-08-10 00:19:23 +00:00
SUB_PATH: process.env.SUB_PATH || "",
2021-08-08 22:10:32 +00:00
axios: {
browserBaseURL: process.env.SUB_PATH || "",
},
2021-08-08 19:17:03 +00:00
},
2021-08-08 22:10:32 +00:00
privateRuntimeConfig: {},
2021-08-08 04:21:44 +00:00
proxy: {
2021-08-08 19:17:03 +00:00
// "http://localhost:9000/*/api",
// See Proxy section
2021-08-10 00:19:23 +00:00
[`${process.env.SUB_PATH || ""}api`]: {
2021-08-08 22:10:32 +00:00
pathRewrite: {
2021-08-10 00:19:23 +00:00
[`${process.env.SUB_PATH || ""}api`]: "/api", // rewrite path
2021-08-08 22:10:32 +00:00
},
changeOrigin: true,
target: process.env.API_URL || "http://localhost:9000",
},
"/api": {
2021-08-08 04:21:44 +00:00
changeOrigin: true,
2021-08-08 19:17:03 +00:00
target: process.env.API_URL || "http://localhost:9000",
2021-08-08 04:21:44 +00:00
},
},
2021-07-31 22:00:28 +00:00
// PWA module configuration: https://go.nuxtjs.dev/pwa
pwa: {
manifest: {
2021-08-02 03:24:47 +00:00
lang: "en",
},
2021-07-31 22:00:28 +00:00
},
// Vuetify module configuration: https://go.nuxtjs.dev/config-vuetify
vuetify: {
2021-08-02 03:24:47 +00:00
customVariables: ["~/assets/variables.scss"],
2021-08-07 19:28:20 +00:00
icons: {
iconfont: "mdiSvg", // 'mdi' || 'mdiSvg' || 'md' || 'fa' || 'fa4' || 'faSvg'
},
defaultAssets: {
font: {
family: "Roboto",
},
icons: false,
},
2021-07-31 22:00:28 +00:00
theme: {
options: {
customProperties: true,
},
2021-08-02 03:24:47 +00:00
dark: false,
2021-07-31 22:00:28 +00:00
themes: {
dark: {
2021-08-02 03:24:47 +00:00
primary: "#E58325",
accent: "#007A99",
2021-08-02 03:24:47 +00:00
secondary: "#973542",
success: "#43A047",
info: "#1976d2",
warning: "#FF6D00",
2021-08-02 03:24:47 +00:00
error: "#EF5350",
},
light: {
primary: "#E58325",
accent: "#007A99",
2021-08-02 03:24:47 +00:00
secondary: "#973542",
success: "#43A047",
info: "#1976d2",
warning: "#FF6D00",
2021-08-02 03:24:47 +00:00
error: "#EF5350",
},
},
},
2021-07-31 22:00:28 +00:00
},
// Build Configuration: https://go.nuxtjs.dev/config-build
2021-08-08 04:21:44 +00:00
build: {
2021-08-09 05:15:20 +00:00
// https://nuxtjs.org/docs/2.x/configuration-glossary/configuration-build
2021-08-10 00:19:23 +00:00
analyze: process.env.NODE_ENV !== "production",
2021-08-08 19:17:03 +00:00
babel: {
plugins: [["@babel/plugin-proposal-private-property-in-object", { loose: true }]],
},
2021-08-09 05:15:20 +00:00
transpile: process.env.NODE_ENV !== "production" ? [/@vue[\\/]composition-api/] : null,
2021-08-08 04:21:44 +00:00
},
2021-08-02 03:24:47 +00:00
};