-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnuxt.config.js
158 lines (154 loc) · 3.66 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
const webpack = require('webpack')
const { base_url, node_env, google_analytics } = require('./config')
const isDevMode = node_env !== 'production' ? true : false
module.exports = {
mode: 'universal',
/*
** Headers of the page
*/
head: {
htmlAttrs: {
lang: 'tk',
},
title: 'Serpaý – Goşgular Çemeni',
meta: [
{ charset: 'utf-8' },
{ 'http-equiv': 'X-UA-Compatible', content: 'IE=edge' },
{ name: 'viewport', content: 'width=device-width, initial-scale=1' },
{ hid: 'description', name: 'description', content: 'Türkmen edebiýatyndan goşgular çemeni' }
],
link: [
{ rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' },
{ rel: 'icon', type: 'image/png', href: '/favicon.png' }
],
noscript: [
{ innerHTML: 'This website requires JavaScript.' }
],
script: [
{
src: `https://www.googletagmanager.com/gtag/js?id=${google_analytics}`, async: true
},
{
innerHTML: `window.dataLayer = window.dataLayer || [];function gtag(){window.dataLayer.push(arguments);}gtag('js', new Date());gtag('config', '${google_analytics}');`,
type: 'text/javascript',
defer: true
}
],
__dangerouslyDisableSanitizers: ['script']
},
/*
** Customize the progress-bar color
*/
loading: { color: '#080808' },
/*
** Global CSS
*/
css: [
'element-ui/lib/theme-chalk/index.css',
'quill/dist/quill.snow.css'
],
/*
** Plugins to load before mounting the App
*/
plugins: [
{ src: '@/plugins/element-ui.js' },
{ src: '@/plugins/quill-editor.client.js' }
],
dev: isDevMode,
/*
** Nuxt.js modules
*/
modules: [
// Doc: https://github.com/nuxt-community/axios-module#usage
'@nuxtjs/axios',
'cookie-universal-nuxt',
'@nuxtjs/sitemap',
['@nuxtjs/component-cache', { maxAge: 1000 * 60 * 60 }],
['nuxt-social-meta', {
url: 'https://serpay.penjire.com',
title: 'Serpaý – Goşgular Çemeni',
description: 'Türkmen edebiýatyndan goşgular çemeni',
img: '/favicon.png',
locale: 'tk_TM',
twitter: '@penjire',
themeColor: '#080808'
}]
],
// app sitemap
sitemap: {
path: '/sitemap.xml',
hostname: 'https://serpay.penjire.com',
cacheTime: 1000 * 60 * 10,
gzip: true,
generate: false, // Enable me when using nuxt generate
exclude: [
'/@serpay',
'/@serpay/**'
],
routes: [
{
url: '/p/gurbannazar-ezizow',
changefreq: 'daily',
priority: 1
},
{
url: '/p/çary-ýegenmyradow',
changefreq: 'daily',
priority: 1
},
{
url: '/p/kerim-gurbannepesow',
changefreq: 'daily',
priority: 1
}
]
},
/*
** Axios module configuration
*/
axios: {
baseURL: base_url,
credentials: true,
debug: isDevMode,
retry: {
retries: 3
},
proxy: true
},
serverMiddleware: ['@/common/cache.js'],
/*
* Render (preload & prefetch)
*/
render: {
http2: {
push: true
},
bundleRenderer: {
shouldPrefetch: (file, type) => ['script', 'style', 'font'].includes(type) && !file.includes('@admin')
}
},
/*
** Build configuration
*/
build: {
plugins: [
new webpack.ProvidePlugin({
'window.Quill': 'quill'
})
],
/*
** You can extend webpack config here
*/
extend(config, { isDev, isClient}) {
// Run ESLint on save
if (isDev && isClient) {
config.module.rules.push({
enforce: 'pre',
test: /\.(js|vue)$/,
loader: 'eslint-loader',
exclude: /(node_modules)/
})
}
}
}
}