summaryrefslogtreecommitdiffstats
path: root/build/generate-svg.js
diff options
context:
space:
mode:
Diffstat (limited to 'build/generate-svg.js')
-rwxr-xr-xbuild/generate-svg.js13
1 files changed, 6 insertions, 7 deletions
diff --git a/build/generate-svg.js b/build/generate-svg.js
index 97053a2958..3e14f906e3 100755
--- a/build/generate-svg.js
+++ b/build/generate-svg.js
@@ -1,11 +1,10 @@
-#!/usr/bin/env node
-'use strict';
-
-const fastGlob = require('fast-glob');
-const {optimize, extendDefaultPlugins} = require('svgo');
-const {resolve, parse} = require('path');
-const {readFile, writeFile, mkdir} = require('fs').promises;
+import fastGlob from 'fast-glob';
+import {optimize, extendDefaultPlugins} from 'svgo';
+import {resolve, parse, dirname} from 'path';
+import {readFile, writeFile, mkdir} from 'fs/promises';
+import {fileURLToPath} from 'url';
+const __dirname = dirname(fileURLToPath(import.meta.url));
const glob = (pattern) => fastGlob.sync(pattern, {cwd: resolve(__dirname), absolute: true});
const outputDir = resolve(__dirname, '../public/img/svg');