Add a script to create an index for Algolia

This commit is contained in:
Jordan Eldredge 2018-11-26 23:19:52 -08:00
parent 78878a0e00
commit 80d8ff99ea
2 changed files with 11 additions and 1 deletions

View file

@ -19,7 +19,8 @@
"build": "react-scripts build",
"test": "react-scripts test --env=jsdom",
"eject": "react-scripts eject",
"build-index": "node ./scripts/findSkins.js"
"build-index": "node ./scripts/findSkins.js",
"create-search-index": "node ./scripts/createSearchIndex.js > index.json"
},
"prettier": {},
"browserslist": [

View file

@ -0,0 +1,9 @@
const skins = require("../src/skins.json");
const indexes = [];
Object.entries(skins).forEach(([hash, { fileName }]) => {
indexes.push({ objectID: hash, fileName });
});
console.log(JSON.stringify(indexes, null, 2));