This repository has been archived by the owner on May 24, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathnuxt.config.js
160 lines (152 loc) · 3.64 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
import { generateRoutes } from './util/ghost'
const pkg = require('./package')
require('dotenv').config()
export default {
mode: 'universal',
/*
** Headers of the page
*/
head: {
// title: pkg.name,
meta: [
{ charset: 'utf-8' },
{ name: 'viewport', content: 'width=device-width, initial-scale=1' },
{ hid: 'description', name: 'description', content: pkg.description }
]
},
/*
** Add overriding info for meta items
*/
meta: {
name: 'JSNG' // this is needed to change title for all PWA meta tags
},
/*
** Customize the progress-bar color
*/
loading: { color: '#e84b0d' },
/*
** Global CSS
*/
css: ['@/assets/css/main.scss'],
/*
** Global page transition
** https://nuxtjs.org/api/configuration-transition#the-pagetransition-property
** Configure the page transition classes is ~assets/css/main.scss
** Currently disabled and using basic css animation as this doesn't have effect on generated sites
*/
// pageTransition: {
// name: 'page',
// modde: 'in-out'
// },
// layoutTransition: {
// name: 'page',
// modde: 'in-out'
// },
/*
** Plugins to load before mounting the App
*/
plugins: ['~plugins/filters.js'],
/*
** Nuxt.js dev-modules
*/
buildModules: [
// Doc: https://github.com/nuxt-community/eslint-module
'@nuxtjs/eslint-module',
// Doc: https://github.com/nuxt-community/stylelint-module
'@nuxtjs/stylelint-module'
],
/*
** Nuxt.js modules
*/
modules: [
// Doc: https://axios.nuxtjs.org/usage
// '@nuxtjs/axios',
'@nuxtjs/pwa',
'@nuxtjs/dotenv',
'@nuxtjs/style-resources',
'nuxt-purgecss',
'@nuxtjs/sitemap'
],
eslint: {
// configure @nuxtjs/eslint-module
fix: true
},
purgeCSS: {
// configure purgecss
type: 'webpack'
},
stylelint: {
fix: true
},
styleResources: {
scss: ['~assets/css/_variables.scss']
},
sitemap: {
hostname: process.env.SITE_URL,
gzip: true,
// exclude can be used to exclude non-dynamic routes from the site-map
// Any route in the generate.routes property will be added to the sitemap
// and it doesn't appear such a route can be excluded
exclude: ['/404']
},
env: {
// loaded from .env file locally and from netlify in deployment
ghostUri: process.env.GHOST_URI,
ghostKey: process.env.GHOST_KEY,
siteUrl: process.env.SITE_URL
},
workbox: {
dev: false
},
/*
* Generate dynamic routes for static site generations
*/
generate: {
subFolders: false,
routes: generateRoutes
},
/*
** Extend routes so multiple routes can use same component
*/
router: {
extendRoutes(routes, resolve) {
routes.push({
name: 'PostIndex',
path: '/page/:pageNumber',
component: resolve(__dirname, 'pages/index.vue')
})
routes.push({
name: 'TagIndex',
path: '/tag/:slug/page/:pageNumber',
component: resolve(__dirname, 'pages/tag/_slug.vue')
})
routes.push({
name: 'AuthorIndex',
path: '/author/:slug/page/:pageNumber',
component: resolve(__dirname, 'pages/author/_slug.vue')
})
}
},
/*
** Build configuration
*/
build: {
extractCSS: true,
postcss: {
preset: {
features: {
customProperties: false
}
}
},
extend(config, ctx) {
// config for vue-svg-loader
const svgRule = config.module.rules.find((rule) => rule.test.test('.svg'))
svgRule.test = /\.(png|jpe?g|gif|webp)$/
config.module.rules.push({
test: /\.svg$/,
use: ['babel-loader', 'vue-svg-loader']
})
}
}
}