forked from DrHacknik/Ryujinx-Website
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gridsome.server.js
38 lines (33 loc) · 974 Bytes
/
gridsome.server.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
const nodeExternals = require('webpack-node-externals')
const VuetifyLoaderPlugin = require('vuetify-loader/lib/plugin')
const fs = require('fs')
function addJSONCollection(actions,typeName, path) {
const list = JSON.parse(fs.readFileSync(path));
const collection = actions.addCollection({
typeName: typeName
})
for (const element of list) {
collection.addNode(element)
}
}
module.exports = function (api) {
api.chainWebpack((config, { isServer }) => {
if (isServer) {
config.externals([
nodeExternals({
allowlist: [/^vuetify/]
})
])
}
})
api.configureWebpack({
plugins: [
new VuetifyLoaderPlugin()
]
})
api.loadSource(async actions => {
addJSONCollection(actions, "Team", "./content/team.json")
addJSONCollection(actions, "SocialNavbarElements", "./content/ui/navbar/social.json")
addJSONCollection(actions, "ExtraPagesInfo", "./content/extra_page_infos.json")
})
}