-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnuxt.config.js
127 lines (115 loc) · 3.44 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
export default {
env: {
baseUrl: process.env.VERCEL_URL ? `https://${process.env.VERCEL_URL}` : 'http://localhost:3000'
},
// Global page headers: https://go.nuxtjs.dev/config-head
head: {
title: 'PanLingo',
htmlAttrs: {
lang: 'en'
},
meta: [
{ charset: 'utf-8' },
// { name: 'referrer', content: 'no-referrer'}, // Turned off because some youtube videos will not load.
{ name: 'viewport', content: 'width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no' },
],
link: [
{ rel: 'icon', type: 'image/x-icon', href: '/img/icons/favicon.ico' },
{ rel: 'stylesheet', href: '/vendor/fontawesome-free-5.15.4-web/css/all.min.css' },
],
script: [
{ hid: 'russian-legacy', src: '/js/russian-legacy.js', defer: true },
{ hid: 'papaparse', src: '/vendor/papaparse/papaparse.min.js', defer: true },
{ hid: 'jquery', src: '/vendor/jquery/jquery.min.js', defer: true },
{ hid: 'axios', src: '/vendor/axios/axios.min.js', defer: true },
{ hid: 'underscore', src: '/vendor/underscore/underscore.js', defer: true },
{ hid: 'kyujitai', src: '/vendor/kyujitai/kyujitai.js' },
]
},
// Global CSS: https://go.nuxtjs.dev/config-css
css: [
'css-percentage-circle',
'video.js/dist/video-js.css',
'@/assets/css/zerotohero.scss',
],
router: {
middleware: [
'language-switch',
]
},
vue: {
config: {
runtimeCompiler: true
}
},
// Auto import components: https://go.nuxtjs.dev/config-components
components: true,
// Modules for dev and build (recommended): https://go.nuxtjs.dev/config-modules
buildModules: [
['@nuxtjs/router-extras', { /* module options */ }],
'@nuxtjs/pwa'
],
pwa: {
manifest: {
name: 'PanLingo',
short_name: 'PanLingo',
description: 'Learn all languages of the world. Fully open-source.',
theme_color: '#343a40',
useWebmanifestExtension: false
},
workbox: {
runtimeCaching: [{
urlPattern: 'http://server.chinesezerotohero.com/.*',
handler: 'CacheFirst',
options: {
cacheName: 'dictionaries',
expiration: {
maxEntries: 10,
},
},
}],
}
},
googleFonts: {
families: {
Lato: [400, 700],
Pacifico: true
},
display: 'swap'
},
modules: [
'bootstrap-vue/nuxt',
'@nuxtjs/axios',
'nuxt-i18n',
'@nuxtjs/google-fonts',
['nuxt-lazy-load', {
defaultImage: '/img/placeholder-faded.png'
}],
],
bootstrapVue: {
components: ['BFormInput', 'BFormFile', 'BFormGroup', 'BFormSelect', 'BFormTextarea', 'BFormSelectOption', 'BButton', 'BProgress', 'BTable',
'BDropdown', 'BDropdownItem', 'BFormCheckbox', 'BFormCheckboxGroup', 'BFormRadio', 'BButtonGroup', 'BInputGroup', 'BInputGroupAppend', 'BInputGroupText', 'BDropdownDivider', 'BProgressBar', 'BModal'],
directives: ['VBModal']
},
// Plugins to run before rendering page: https://go.nuxtjs.dev/config-plugins
plugins: [
'~plugins/main.js',
{ src: '~/plugins/pwa-update.js', mode: 'client' }
],
build: {
extend(config, { isDev, isClient }) {
config.resolve.alias['vue'] = 'vue/dist/vue.common'
// Extend only webpack config for client-bundle
if (isDev && isClient) {
config.devtool = '#source-map'
} else {
config.devtool = false
}
}
},
generate: {
routes: [
'/'
]
}
}