1
0
mirror of https://github.com/svg/svgo.git synced 2025-07-29 20:21:14 +03:00

feat: export version constant (#2016)

This commit is contained in:
Seth Falco
2024-05-27 20:28:13 +01:00
committed by GitHub
parent a761a01038
commit 78403d3dc9
11 changed files with 63 additions and 19 deletions

View File

@ -2,7 +2,7 @@ import os from 'os';
import fs from 'fs';
import { pathToFileURL } from 'url';
import path from 'path';
import { optimize as optimizeAgnostic } from './svgo.js';
import { VERSION, optimize as optimizeAgnostic } from './svgo.js';
const importConfig = async (configFile) => {
// dynamic import expects file url instead of path and may fail
@ -25,6 +25,8 @@ const isFile = async (file) => {
}
};
export { VERSION };
export const loadConfig = async (configFile, cwd = process.cwd()) => {
if (configFile != null) {
if (path.isAbsolute(configFile)) {