diff --git a/package.json b/package.json index d06e8828..e3d3af41 100644 --- a/package.json +++ b/package.json @@ -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": [ diff --git a/scripts/createSearchIndex.js b/scripts/createSearchIndex.js new file mode 100644 index 00000000..918aace5 --- /dev/null +++ b/scripts/createSearchIndex.js @@ -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));