mirror of
https://github.com/svg/svgo.git
synced 2025-07-31 07:44:22 +03:00
@ -8,7 +8,7 @@ const {
|
||||
createContentItem,
|
||||
} = require('./svgo.js');
|
||||
|
||||
const importConfig = async configFile => {
|
||||
const importConfig = async (configFile) => {
|
||||
const config = require(configFile);
|
||||
if (config == null || typeof config !== 'object' || Array.isArray(config)) {
|
||||
throw Error(`Invalid config file "${configFile}"`);
|
||||
@ -23,7 +23,7 @@ const isFile = async (file) => {
|
||||
} catch {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
const loadConfig = async (configFile, cwd = process.cwd()) => {
|
||||
if (configFile != null) {
|
||||
@ -36,7 +36,7 @@ const loadConfig = async (configFile, cwd = process.cwd()) => {
|
||||
let dir = cwd;
|
||||
// eslint-disable-next-line no-constant-condition
|
||||
while (true) {
|
||||
const file = path.join(dir, "svgo.config.js");
|
||||
const file = path.join(dir, 'svgo.config.js');
|
||||
if (await isFile(file)) {
|
||||
return await importConfig(file);
|
||||
}
|
||||
|
Reference in New Issue
Block a user