mirror of
https://github.com/Ryujinx/Ryujinx-Website.git
synced 2025-01-10 06:57:18 -03:00
31 lines
825 B
JavaScript
31 lines
825 B
JavaScript
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")
|
|
addJSONCollection(actions, "ExtraPagesInfo", "./content/extra_page_infos.json")
|
|
})
|
|
}
|