-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathnuxt.config.js
163 lines (153 loc) · 4.51 KB
/
nuxt.config.js
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
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
import {GOLINK_PATTERN} from './src/shared';
const pkg = require('./package');
require(`dotenv`).config();
export default {
telemetry: false, // https://github.com/nuxt/telemetry
mode: 'universal',
/*
** Headers of the page
*/
head: {
title: process.env.OPEN_GOLINKS_SITE_NAME,
meta: [
{charset: 'utf-8'},
{name: 'viewport', content: 'width=device-width, initial-scale=1'},
{hid: 'description', name: 'description', content: pkg.description},
{uptimerobot_verify_uuid: '89d70f81-d069-43cf-ad7f-b932f7e3a24b'}, // a random uuid for verification purpose
],
link: [
// rel: 'icon', type: 'image/x-icon', href: '/favicon.ico'},
{
rel: 'stylesheet',
href: 'https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css',
// integrity: 'sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO',
},
{
rel: 'stylesheet',
href: 'https://use.fontawesome.com/releases/v5.8.1/css/all.css',
// integrity: 'sha384-50oBUHEmvpQ+1lW4y57PTFmhCaXp0ML5d60M1M7uH2+nqUivzIebhndOJK28anvf',
// crossorigin: 'anonymouse'
}
],
script: [
{
src: "https://code.jquery.com/jquery-3.3.1.slim.min.js",
//integrity: "sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo",
type: "text/javascript",
//crossorigin: "anonymous"
},
{
src: "https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.3/umd/popper.min.js",
//integrity: "sha384-ZMP7rVo3mIykV+2+9J3UJ46jBk0WLaUAdn689aCwoqbBJiSnjAK/l8WvCWPIPm49",
type: "text/javascript",
//crossorigin: "anonymous"
},
{
src: "https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.min.js",
//integrity: "sha384-ChfqqxuZUCnJSK3+MXmPNIyE6ZbWh2IMqE241rYiqJxyMiZ6OW/JmZQ5stwEULTy",
type: "text/javascript",
//crossorigin: "anonymous"
},
],
bodyAttrs: {
class: 'h-100'
},
},
/*
** Customize the progress-bar color
*/
loading: {color: '#fff'},
/*
** Global CSS
*/
css: [
`@/static/css/main.css`,
],
// Define your configuration with auto-completion & type checking
buildModules: ['@nuxt/typescript-build'],
/*
** Nuxt.js modules
*/
modules: [
// Doc: https://axios.nuxtjs.org/usage
'@nuxtjs/axios',
// Doc: https://bootstrap-vue.js.org/docs/
'bootstrap-vue/nuxt',
['nuxt-env', {
keys: [
'HOST',
'PORT',
'OPEN_GOLINKS_SITE_HOST_AND_PORT',
'OPEN_GOLINKS_SITE_PROTOCOL',
'OPEN_GOLINKS_SITE_NAME',
]
}],
],
/*
** Axios module configuration
*/
axios: {
// See https://github.com/nuxt-community/axios-module#options
credentials: true
},
bootstrapVue: {
config: {
// Custom config options here
}
},
/*
** Build configuration
*/
build: {
babel: {
presets({ isServer }) {
return [
[
"@nuxt/babel-preset-app", { loose: true }
]
]
}
},
transpile: [
"vee-validate/dist/rules",
"vee-validate/dist/vee-validate.full.esm"
],
extend (config, {isDev, isClient}) {
if (isDev) {
config.devtool = isClient ? 'source-map' : 'inline-source-map';
}
},
},
router: {
extendRoutes (routes, resolve) {
routes.push({
path: `/dashboard`,
// TODO temporary redirect to GA dashboard
redirect: 'https://analytics.google.com/analytics/web/?utm_source=marketingplatform.google.com&utm_medium=et&utm_campaign=marketingplatform.google.com%2Fabout%2Fanalytics%2F#/p392371036/realtime/pages?params=_u..nav%3Dmaui&collectionId=life-cycle'
// TODO remove temporary redirect when we update the dashboard
// component: resolve(__dirname, "pages/dashboard.vue")
});
routes.push({
path: `/edit/:goLink(${GOLINK_PATTERN})?`,
component: resolve(__dirname, 'pages/link.vue'),
});
routes.push({
path: `/:goLink(${GOLINK_PATTERN})?`,
// TODO add GA4 tracking when miss or hit
component: resolve(__dirname, 'pages/redirect.vue'),
});
}
},
serverMiddleware: [
// Will register file from project server-middleware directory to handle /server-middleware/* requires
{ path: '/', handler: '~/src/routes/index.ts' },
],
/*
** Plugins to load before mounting the App
*/
plugins: [
'@/plugins/axios.ts',
"@/plugins/vee-validate.ts",
"@/plugins/clipboard.ts"
],
};