Hangar/frontend/nuxt.config.ts

147 lines
4.4 KiB
TypeScript
Raw Normal View History

2021-01-31 01:27:36 +08:00
// @ts-ignore
2021-01-21 11:36:18 +08:00
import colors from 'vuetify/es5/util/colors';
2021-01-31 10:00:11 +08:00
import { NuxtConfig } from '@nuxt/types';
2021-01-23 06:36:52 +08:00
import en from './locales/en';
import fr from './locales/fr';
2021-01-21 11:36:18 +08:00
require('dotenv').config();
export default {
telemetry: false,
2021-01-21 11:36:18 +08:00
// Global page headers: https://go.nuxtjs.dev/config-head
head: {
2021-01-23 06:36:52 +08:00
titleTemplate: (titleChunk: string) => {
2021-01-22 04:32:08 +08:00
return titleChunk ? `${titleChunk} | Hangar` : 'Hangar';
},
2021-01-21 11:36:18 +08:00
meta: [
{ charset: 'utf-8' },
{ name: 'viewport', content: 'width=device-width, initial-scale=1' },
{ hid: 'description', name: 'description', content: '' },
],
link: [{ rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' }],
},
// Global CSS: https://go.nuxtjs.dev/config-css
2021-01-23 03:50:57 +08:00
css: [],
2021-01-21 11:36:18 +08:00
// Plugins to run before rendering page: https://go.nuxtjs.dev/config-plugins
2021-01-23 03:50:57 +08:00
plugins: ['~/plugins/api.ts', '~/plugins/auth.ts', '~/plugins/utils.ts'],
2021-01-21 11:36:18 +08:00
// Auto import components: https://go.nuxtjs.dev/config-components
components: false, // Can change this back if you really want, but it doesn't look like Webstorm or Intellij understand what's going on if they aren't imported. Also, does it really matter? It's just a few imports
2021-01-21 11:36:18 +08:00
// Modules for dev and build (recommended): https://go.nuxtjs.dev/config-modules
buildModules: [
// https://go.nuxtjs.dev/typescript
'@nuxt/typescript-build',
// https://go.nuxtjs.dev/vuetify
'@nuxtjs/vuetify',
2021-01-31 10:00:11 +08:00
// https://go.nuxtjs.dev/eslint
'@nuxtjs/eslint-module',
2021-01-22 04:32:08 +08:00
'@nuxtjs/dotenv',
2021-01-21 11:36:18 +08:00
],
// Modules: https://go.nuxtjs.dev/config-modules
modules: [
// https://go.nuxtjs.dev/axios
'@nuxtjs/axios',
// https://go.nuxtjs.dev/pwa
'@nuxtjs/pwa',
'cookie-universal-nuxt',
2021-01-22 03:47:58 +08:00
'@nuxtjs/proxy',
2021-01-23 05:06:44 +08:00
'nuxt-i18n',
2021-01-21 11:36:18 +08:00
],
// Axios module configuration: https://go.nuxtjs.dev/config-axios
2021-01-23 13:24:48 +08:00
axios: {},
2021-01-21 11:36:18 +08:00
// PWA module configuration: https://go.nuxtjs.dev/pwa
pwa: {
manifest: {
lang: 'en',
},
},
// Vuetify module configuration: https://go.nuxtjs.dev/config-vuetify
vuetify: {
customVariables: ['~/assets/variables.scss'],
2021-01-31 01:27:36 +08:00
preset: 'vue-cli-plugin-vuetify-preset-reply/preset',
treeShake: true,
2021-01-21 11:36:18 +08:00
theme: {
2021-01-31 10:00:11 +08:00
default: 'dark',
2021-01-21 11:36:18 +08:00
dark: true,
2021-01-31 10:00:11 +08:00
disable: false,
options: {},
2021-01-21 11:36:18 +08:00
themes: {
dark: {
2021-01-31 10:00:11 +08:00
anchor: colors.blue.lighten3,
primary: colors.blue.darken2,
accent: colors.grey.darken3,
secondary: colors.amber.darken3,
info: colors.teal.lighten1,
warning: colors.amber.base,
error: colors.deepOrange.accent4,
success: colors.green.accent3,
},
light: {
anchor: colors.blue.lighten3,
2021-01-21 11:36:18 +08:00
primary: colors.blue.darken2,
accent: colors.grey.darken3,
secondary: colors.amber.darken3,
info: colors.teal.lighten1,
warning: colors.amber.base,
error: colors.deepOrange.accent4,
success: colors.green.accent3,
},
},
},
},
// Build Configuration: https://go.nuxtjs.dev/config-build
2021-01-31 01:27:36 +08:00
build: {
transpile: ['vue-cli-plugin-vuetify-preset-reply', 'lodash-es'],
2021-01-31 01:27:36 +08:00
},
2021-01-22 03:47:58 +08:00
2021-01-22 11:11:24 +08:00
router: {
middleware: 'auth',
},
2021-01-31 03:55:24 +08:00
proxy: [
'http://localhost:8080/api/',
'http://localhost:8080/signup',
'http://localhost:8080/login',
'http://localhost:8080/logout',
2021-02-03 07:47:15 +08:00
'http://localhost:8080/refresh',
'http://localhost:8080/invalidate',
2021-01-31 03:55:24 +08:00
'http://localhost:8080/v2/api-docs/',
],
2021-01-22 03:47:58 +08:00
2021-01-23 05:06:44 +08:00
i18n: {
vueI18nLoader: true,
strategy: 'no_prefix',
defaultLocale: 'en',
locales: [
{ code: 'fr', iso: 'fr-FR', name: 'Français' },
{ code: 'en', iso: 'en-US', name: 'English' },
],
vueI18n: {
locale: 'en',
fallbackLocale: 'en',
messages: {
en,
fr,
},
},
2021-01-31 10:00:11 +08:00
},
2021-01-23 05:06:44 +08:00
2021-01-22 03:47:58 +08:00
server: {
port: 3000,
host: 'localhost',
},
2021-01-31 02:50:12 +08:00
loading: {
continuous: true,
},
2021-01-31 10:00:11 +08:00
} as NuxtConfig;