-
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathnuxt.config.js
250 lines (236 loc) · 6.83 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
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
import join from 'memory-fs/lib/join'
const metaTitle = 'Planetside 2 Alert Tracker'
const metaDesc = "PS2Alerts - Building Planetside 2's Alert metagame"
const metaImg = `${process.env.BASE_URL}/og-image.png`
export default {
// We're forced to use env injection for this otherwise we can't build it into class constructors.
env: {
apiHost: process.env.API_HOST ?? 'https://dev.api.ps2alerts.com',
},
publicRuntimeConfig: {
baseUrl: process.env.BASE_URL ?? 'https://dev.ps2alerts.com',
build: process.env.BUILD ?? 'DEV',
built: process.env.BUILT ?? 'Now?',
environment: process.env.ENV ?? 'Development',
version: process.env.VERSION ?? 'DEV',
maintenance: false,
},
server: {
port: process.env.APP_PORT ?? 3000,
host: '0.0.0.0',
timing: false,
},
target: 'static',
// Global page headers (https://go.nuxtjs.dev/config-head)
head: {
title: 'PS2Alerts',
meta: [
{ charset: 'utf-8' },
{ name: 'viewport', content: 'width=device-width, initial-scale=1' },
{ name: 'title', content: metaTitle },
{
hid: 'description',
name: 'description',
content: metaDesc,
},
{
hid: 'og:description',
property: 'og:description',
content: metaDesc,
},
{
hid: 'og:title',
property: 'og:title',
content: metaTitle,
},
{
hid: 'og:image',
property: 'og:image',
content: metaImg,
},
{
hid: 'og:type',
property: 'og:type',
content: 'website',
},
{
hid: 'og:site_name',
property: 'og:site_name',
content: 'PS2Alerts',
},
{
hid: 'twitter:title',
property: 'twitter:title',
content: metaTitle,
},
{
hid: 'twitter:description',
property: 'twitter:description',
content: metaTitle,
},
{
hid: 'twitter:image',
property: 'twitter:image',
content: metaImg,
},
{
hid: 'twitter:image:alt',
property: 'twitter:image:alt',
content: metaTitle,
},
{
hid: 'twitter:card',
property: 'twitter:card',
content: 'summary_large_image',
},
],
link: [{ rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' }],
},
// Global CSS (https://go.nuxtjs.dev/config-css)
css: ['~assets/css/tailwind.scss'],
// Plugins to run before rendering page (https://go.nuxtjs.dev/config-plugins)
plugins: [
{ src: '@/filters/BracketName', mode: 'client' },
{ src: '@/filters/DateTimeFormat', mode: 'client' },
{ src: '@/filters/FacilityTypeShortName', mode: 'client' },
{ src: '@/filters/FactionCircleEmoji', mode: 'client' },
{ src: '@/filters/FactionId', mode: 'client' },
{ src: '@/filters/FactionImage', mode: 'client' },
{ src: '@/filters/FactionName', mode: 'client' },
{ src: '@/filters/FactionOrTeamName', mode: 'client' },
{ src: '@/filters/FactionShortName', mode: 'client' },
{ src: '@/filters/ItemShortName', mode: 'client' },
{ src: '@/filters/OrdinalSuffix', mode: 'client' },
{ src: '@/filters/OutfitImage', mode: 'client' },
{ src: '@/filters/OWRoundByPhase', mode: 'client' },
{ src: '@/filters/PhaseName', mode: 'client' },
{ src: '@/filters/TeamName', mode: 'client' },
{ src: '@/filters/UcFirst', mode: 'client' },
{ src: '@/filters/VehicleFaction', mode: 'client' },
{ src: '@/filters/WorldName', mode: 'client' },
{ src: '@/filters/ZoneName', mode: 'client' },
{ src: '@/plugins/NumeralFilter', mode: 'client' },
],
// Auto import components (https://go.nuxtjs.dev/config-components)
components: [{ path: '~/components', pathPrefix: false }],
// 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/tailwindcss
'@nuxtjs/tailwindcss',
'@nuxtjs/vuetify',
'@nuxtjs/style-resources',
],
// Modules (https://go.nuxtjs.dev/config-modules)
modules: [
// https://github.com/nuxt-community/google-gtag-module
'@nuxtjs/google-gtag',
// https://go.nuxtjs.dev/axios
'@nuxtjs/axios',
'nuxt-leaflet',
'@nuxtjs/fontawesome',
],
tailwindcss: {
configPath: 'tailwind.config.js',
},
// Axios module configuration (https://go.nuxtjs.dev/config-axios)
axios: {},
// Content module configuration (https://go.nuxtjs.dev/config-content)
content: {},
fontawesome: {
icons: {
solid: [
'faArrowDown',
'faArrowRight',
'faArrowUp',
'faArrowsToDot',
'faBarsProgress',
'faBomb',
'faBullhorn',
'faChartArea',
'faCheck',
'faCodeFork',
'faEquals',
'faExchangeAlt',
'faExclamation',
'faExclamationTriangle',
'faFighterJet',
'faFileVideo',
'faFlag',
'faGun',
'faHourglass',
'faInfoCircle',
'faMap',
'faPause',
'faPlay',
'faPlus',
'faPollH',
'faQuestion',
'faQuestionCircle',
'faRankingStar',
'faRepeat',
'faStar',
'faSync',
'faTasks',
'faTrophy',
'faUndo',
'faUser',
'faUserTag',
'faUsers',
'faVideoCamera',
'faWrench',
'faXmark',
],
brands: ['faDiscord', 'faGithub', 'faTwitter', 'faPatreon', 'faSith'],
},
},
// https://www.npmjs.com/package/@nuxtjs/vuetify
vuetify: {
theme: { dark: true },
treeShake: true, // required for scss vars to work
},
'google-gtag': {
id: process.env.GOOGLE_PROPERTY,
debug: process.env.ENV !== 'production', // enable to track in dev / staging mode
},
router: {
scrollBehavior() {
const elem = document.getElementById('panel-right')
return { x: 0, y: elem.offsetTop - 12 }
},
},
// Build Configuration (https://go.nuxtjs.dev/config-build)
build: {
babel: {
presets({ isServer }) {
const targets = isServer ? { node: 'current' } : { ie: 11 }
return [[require.resolve('@babel/preset-env'), { targets }]]
},
plugins: [
'@babel/syntax-dynamic-import',
'@babel/transform-runtime',
'@babel/transform-async-to-generator',
],
},
postcss: {
postcssOptions: {
// Add plugin names as key and arguments as value
// Install them before as dependencies with npm or yarn
plugins: {
tailwindcss: join(__dirname, 'tailwind.config.js'),
'postcss-extend-rule': {},
'postcss-import': {},
'postcss-nested': {},
autoprefixer: {},
},
},
preset: {
// Change the postcss-preset-env settings
autoprefixer: {
grid: true,
},
},
},
},
}