chore: initial commit
This commit is contained in:
commit
3faf8bc4d5
11 changed files with 2761 additions and 0 deletions
28
build.js
Normal file
28
build.js
Normal file
|
@ -0,0 +1,28 @@
|
|||
const fs = require('fs');
|
||||
const path = `./node_modules/@tabler/icons/icons/filled/`;
|
||||
const fileNames = fs.readdirSync(path);
|
||||
const object = {};
|
||||
const CONTENTS = {
|
||||
HEAD: "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" stroke-width=\"2\" stroke=\"currentColor\" fill=\"none\" stroke-linecap=\"round\" stroke-linejoin=\"round\">",
|
||||
TAIL: "</svg>",
|
||||
};
|
||||
|
||||
fileNames.forEach((filename) => {
|
||||
const contents = fs
|
||||
.readFileSync(path + filename)
|
||||
.toString()
|
||||
.trimEnd();
|
||||
const lines = contents.split("\n");
|
||||
const guts = lines
|
||||
.slice(1, lines.length - 1)
|
||||
.join("")
|
||||
.replace(/\ \ /g, "");
|
||||
if (object) object[filename.slice(0, -4)] = guts;
|
||||
});
|
||||
|
||||
fs.writeFileSync(
|
||||
"./icons.js",
|
||||
`// Generated by build.js at ${new Date().toISOString()}\n\nmodule.exports = ${JSON.stringify(
|
||||
{...object, HEAD: CONTENTS['HEAD'], TAIL: CONTENTS['TAIL']}
|
||||
)};\n`
|
||||
);
|
Loading…
Add table
Add a link
Reference in a new issue