-
Notifications
You must be signed in to change notification settings - Fork 0
/
nuxt.config.ts
129 lines (118 loc) · 3.11 KB
/
nuxt.config.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
import { NuxtConfig } from '@nuxt/types';
import { name as PACKAGE_NAME } from './package.json';
import { PORT } from './server';
const isDev = process.env.NODE_ENV !== 'production';
const typeCheck = isDev
? {
eslint: {
files: './**/*.{ts,js,vue}',
},
}
: false;
export const PRODUCTION_HOST_URL =
process.env.DEPLOY_ENV === 'GH_PAGES'
? 'shaggytech.com'
: 'vin.dubsquared.com';
const META_TITLE = 'VIN Decoder';
const META_URL = isDev ? `localhost:${PORT}/` : PRODUCTION_HOST_URL;
const META_DESCRIPTION =
'A web app to decode Vehicle Identification Numbers (VIN) using the NHTSA.dot.gov Vehicles API.';
const routerBase =
process.env.DEPLOY_ENV === 'GH_PAGES'
? { router: { base: `/${PACKAGE_NAME}/` } }
: {};
const config: NuxtConfig = {
rootDir: __dirname,
target: 'server',
buildDir: '.nuxt',
generate: { dir: 'dist' },
telemetry: false,
dev: isDev,
...routerBase,
loading: { color: '#fff' },
css: ['~/assets/css/main.scss'],
/* Auto import components */
components: [
'~/components',
{
path: '~/components/app/',
prefix: 'App',
},
{
path: '~/components/base/',
prefix: 'Base',
},
{
path: '~/components/VinDecoder/',
prefix: 'VinDecoder',
},
],
// https://nuxtjs.org/blog/moving-from-nuxtjs-dotenv-to-runtime-config/
publicRuntimeConfig: {},
privateRuntimeConfig: {},
render: {
asyncScripts: true,
},
head: {
// titleTemplate: '%s - ',
htmlAttrs: {
lang: 'en',
},
title: META_TITLE,
meta: [
{ charset: 'utf-8' },
{ name: 'viewport', content: 'width=device-width, initial-scale=1' },
{ hid: 'description', name: 'description', content: META_DESCRIPTION },
{ property: 'og:title', content: META_TITLE },
{ property: 'og:type', content: 'website' },
{ property: 'og:image', content: `/og-image.jpg` },
{ property: 'og:image:width', content: '237' },
{ property: 'og:image:height', content: '237' },
{ property: 'og:url', content: META_URL },
{ property: 'og:description', content: META_DESCRIPTION },
],
link: [{ rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' }],
},
plugins: ['~/plugins/vee-validate.ts'],
buildModules: [
'@nuxtjs/composition-api/module',
'@nuxtjs/eslint-module',
'@nuxtjs/vuetify',
'@nuxt/typescript-build',
'nuxt-typed-vuex',
],
modules: ['@nuxtjs/axios', '@nuxtjs/pwa', 'nuxt-webfontloader'],
pwa: {
meta: {
// nativeUI: false,
theme_color: '#78a0ff',
ogHost: 'shaggytech.com',
},
manifest: {
name: 'Vehicle Information Decoder',
short_name: 'VIN Decoder',
},
},
// Runtime type checking when running nuxt build
typescript: {
typeCheck,
},
vuetify: {
defaultAssets: false,
optionsPath: '~/plugins/vuetify.ts',
},
webfontloader: {
google: {
families: ['Rubik:400,500,700&display=swap'],
},
},
build: {
extractCSS: !isDev,
transpile: [
'vee-validate/dist/rules',
'vuetify/lib/util/colors',
'/typed-vuex/',
],
},
};
export default config;