Skip to content

Commit

Permalink
fix(config): use dynamic import for now
Browse files Browse the repository at this point in the history
hot fix, more on this later
  • Loading branch information
Lioness100 committed Feb 22, 2023
1 parent 3ab332d commit d2043b6
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { extname } from 'node:path';
import { existsSync } from 'node:fs';
import { readFile, writeFile } from 'node:fs/promises';
import { searchForConfig, type CSpellSettings } from 'cspell-lib';
import findDefaultConfigPath from 'application-config-path';
import { previousState } from './shared';

let configPath: string | undefined;
Expand All @@ -16,7 +15,7 @@ export const findOrCreateConfig = async (config?: string) => {
const configSource = config ?? (await searchForConfig(process.cwd()))?.__importRef?.filename;

// If no config file was found, use/create a config file in the user's configuration directory (platform dependent).
const path = configSource ?? findDefaultConfigPath('cspell.json');
const path = configSource ?? (await import('application-config-path')).default('cspell.json');

// Only JSON files are supported to prevent more dependencies for yml parsing. If the config file is not a JSON
// file, it can still be used, but it won't be updated with new ignored words.
Expand Down

0 comments on commit d2043b6

Please sign in to comment.