summaryrefslogtreecommitdiffstats
path: root/build/build-svgs.mjs
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2023-05-03 09:09:58 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2023-05-03 09:09:58 +0000
commitfbbea065828865399d8bc6dd607b7205bff2c5a8 (patch)
treee3238379197e6288160e4d3a27520e1880d6524f /build/build-svgs.mjs
parentAdding upstream version 1.10.4+dfsg. (diff)
downloadbootstrap-icons-fbbea065828865399d8bc6dd607b7205bff2c5a8.tar.xz
bootstrap-icons-fbbea065828865399d8bc6dd607b7205bff2c5a8.zip
Adding upstream version 1.10.5+dfsg.upstream/1.10.5+dfsg
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r--build/build-svgs.mjs (renamed from build/build-svgs.js)16
1 files changed, 9 insertions, 7 deletions
diff --git a/build/build-svgs.js b/build/build-svgs.mjs
index ed868e6..2927156 100644
--- a/build/build-svgs.js
+++ b/build/build-svgs.mjs
@@ -1,12 +1,14 @@
#!/usr/bin/env node
-'use strict'
+import fs from 'node:fs/promises'
+import path from 'node:path'
+import process from 'node:process'
+import { fileURLToPath } from 'node:url'
+import picocolors from 'picocolors'
+import { loadConfig, optimize } from 'svgo'
-const fs = require('node:fs').promises
-const path = require('node:path')
-const process = require('node:process')
-const picocolors = require('picocolors')
-const { loadConfig, optimize } = require('svgo')
+const __filename = fileURLToPath(import.meta.url)
+const __dirname = path.dirname(fileURLToPath(import.meta.url))
const iconsDir = path.join(__dirname, '../icons/')
@@ -40,7 +42,7 @@ async function processFile(file, config) {
console.time(timeLabel)
const files = await fs.readdir(iconsDir)
- const config = await loadConfig(path.join(__dirname, '../svgo.config.js'))
+ const config = await loadConfig(path.join(__dirname, '../svgo.config.mjs'))
await Promise.all(files.map(file => processFile(file, config)))