generated from youthradio/static-nuxt-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
nuxt.config.js
145 lines (142 loc) · 3.97 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
import POSTCONFIG from './post.config'
export default {
telemetry: false,
target: 'static',
mode: 'universal',
/*
** Headers of the page
*/
router: {
base: POSTCONFIG.baseURL,
},
head: {
title: POSTCONFIG.title,
meta: [
{ charset: 'utf-8' },
{ name: 'viewport', content: 'width=device-width, initial-scale=1' },
{
hid: 'description',
name: 'description',
content: POSTCONFIG.description,
},
{ property: 'og:title', content: POSTCONFIG.title },
{ property: 'og:site_name', content: POSTCONFIG.title },
{ property: 'og:type', content: 'website' },
{ property: 'og:url', content: POSTCONFIG.url },
{ property: 'og:image', content: POSTCONFIG.featureImage },
{ property: 'og:description', content: POSTCONFIG.description },
{ property: 'og:image:alt', content: POSTCONFIG.featureImageDescription },
{ property: 'fb:app_id', content: POSTCONFIG.fbAppID },
{ name: 'twitter:card', content: 'summary_large_image' },
{ name: 'twitter:creator', content: POSTCONFIG.twitterHandler },
{ name: 'twitter:site', content: POSTCONFIG.twitterHandler },
{ name: 'twitter:title', content: POSTCONFIG.title },
{ name: 'twitter:description', content: POSTCONFIG.description },
{ name: 'twitter:image', content: POSTCONFIG.featureImage },
{
name: 'twitter:image:alt',
content: POSTCONFIG.featureImageDescription,
},
{ itemprop: 'description', content: POSTCONFIG.description },
{ itemprop: 'image', content: POSTCONFIG.featureImage },
{ name: 'msapplication-TileColor', content: '#da532c' },
{ name: 'theme-color', content: '#ffffff' },
],
link: [
{
rel: 'icon',
type: 'apple-touch-icon',
sizes: '180x180',
href: 'favicon/apple-touch-icon.png',
},
{
rel: 'icon',
type: 'image/png',
sizes: '32x32',
href: 'favicon/favicon-32x32.png',
},
{
rel: 'icon',
type: 'image/png',
sizes: '16x16',
href: 'favicon/favicon-16x16.png',
},
{ rel: 'shortcut icon', href: 'favicon/favicon-32x32.png' },
{ rel: 'manifest', href: 'favicon/site.webmanifest' },
{
rel: 'mask-icon',
color: '#5bbad5',
href: 'favicon/safari-pinned-tab.svg',
},
{
rel: 'preload stylesheet',
href: 'https://interactive.yr.media/yr-media-typography/yr-typography.css',
as: 'style',
onload: `this.onload=null;this.rel='stylesheet'`,
},
],
},
/*
** Customize the progress-bar color
*/
loading: { color: '#fff' },
/*
** Global CSS
*/
css: [],
/*
** Plugins to load before mounting the App
*/
plugins: [
{
src: '~plugins/lazysizes.js',
ssr: false,
},
{
src: '~plugins/vue-observable.js',
ssr: false,
},
],
/*
** Nuxt.js dev-modules
*/
buildModules: [
// Doc: https://github.com/nuxt-community/eslint-module
'@nuxtjs/eslint-module',
],
/*
** Nuxt.js modules
*/
modules: ['@nuxtjs/google-gtag'],
'google-gtag': {
id: 'UA-6029148-3',
config: {
anonymize_ip: true, // anonymize IP
page_title: POSTCONFIG.title,
page_path: POSTCONFIG.baseURL,
},
debug: false, // enable to track in dev mode
disableAutoPageTrack: true, // disable if you don't want to track each page route with router.afterEach(...).
},
/*
** Build configuration
*/
build: {
/*
** You can extend webpack config here
*/
extend(config, { isDev, isClient, loaders: { vue } }) {
if (isClient) {
vue.transformAssetUrls.img = ['data-src', 'src']
vue.transformAssetUrls.source = ['data-srcset', 'srcset']
}
},
html: { minify: { collapseWhitespace: true } },
},
// server: {
// https: {
// key: readFileSync(`${process.env.SSLKEY}`),
// cert: readFileSync(`${process.env.SSLCRT}`)
// }
// }
}