Ryujinx-Website/gridsome.server.js

32 lines
825 B
JavaScript
Raw Normal View History

const nodeExternals = require('webpack-node-externals')
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({
whitelist: [/^vuetify/]
})
])
}
})
api.loadSource(async actions => {
addJSONCollection(actions, "Team", "./content/team.json")
addJSONCollection(actions, "SocialNavbarElements", "./content/ui/navbar/social.json")
2020-02-08 15:59:15 +00:00
addJSONCollection(actions, "ExtraPagesInfo", "./content/extra_page_infos.json")
})
}