-
Notifications
You must be signed in to change notification settings - Fork 2
/
boilerplate.coffee
59 lines (51 loc) · 1.39 KB
/
boilerplate.coffee
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
###
Make a boilerplate Nuxt config while accepting some options
###
# Deps
mergeConfig = require './merger'
defaults = require 'lodash/defaults'
# Concerns that make up the whole boilerplate config
concerns = [
require './concerns/axios'
require './concerns/cms'
require './concerns/coffeescript'
require './concerns/components'
require './concerns/credits'
require './concerns/gtm'
require './concerns/fontagon'
require './concerns/helpers'
require './concerns/meta'
require './concerns/perf'
require './concerns/polyfill'
require './concerns/pwa'
require './concerns/robots'
require './concerns/routing'
require './concerns/sentry'
require './concerns/sitemap'
require './concerns/ssg'
require './concerns/styles'
require './concerns/title'
]
# Export merging function
module.exports = (options) ->
# Make default options
options = defaults options,
# The name of the site
siteName: 'New Site'
# Polyfill.io keys
polyfills: [
'default'
'URL'
'NodeList.prototype.forEach'
'IntersectionObserver'
'Element.prototype.remove'
'Object.values'
]
# Craft _typenames for page routes
pageTypes: []
# Merge all the concerns together, excuting their callbacks with the passed
# in options. Filter out empty concerns, like if there was an early return.
settings = concerns
.map (concern) -> concern options
.filter (concern) -> !!concern
mergeConfig.apply null, settings