1
0
mirror of https://github.com/simple-icons/simple-icons.git synced 2025-07-02 22:16:54 +02:00

Minify _data/simple-icons.json on publish (#11903)

This commit is contained in:
LitoMore
2024-10-01 11:52:48 +08:00
committed by GitHub
parent 14ccea31a8
commit 3fa891560b
3 changed files with 14 additions and 1 deletions

View File

@ -32,14 +32,16 @@ export const getJsonSchemaData = async (
* Write icons data to _data/simple-icons.json.
* @param {{icons: IconData[]}} iconsData Icons data object.
* @param {string} rootDirectory Path to the root directory of the project.
* @param {boolean} minify Whether to minify the JSON output.
*/
export const writeIconsData = async (
iconsData,
rootDirectory = path.resolve(__dirname, '..'),
minify,
) => {
await fs.writeFile(
getIconDataPath(rootDirectory),
`${JSON.stringify(iconsData, null, 4)}\n`,
`${JSON.stringify(iconsData, null, minify ? 0 : 4)}\n`,
'utf8',
);
};