Skip to content

Commit

Permalink
Default to production entry file patterns
Browse files Browse the repository at this point in the history
  • Loading branch information
uncenter committed Jan 17, 2024
1 parent 5ed85f1 commit a00ad70
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/knip/src/plugins/eleventy/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { join } from '../../util/path.js';
import { timerify } from '../../util/Performance.js';
import { hasDependency, load } from '../../util/plugin.js';
import { toEntryPattern } from '../../util/protocols.js';
import { toEntryPattern, toProductionEntryPattern } from '../../util/protocols.js';
import { DummyEleventyConfig, defaultEleventyConfig } from './helpers.js';
import type { EleventyConfig } from './types.js';
import type { IsPluginEnabledCallback, GenericPluginCallback } from '../../types/plugins.js';
Expand All @@ -26,7 +26,7 @@ const findEleventyDependencies: GenericPluginCallback = async (configFilePath, o
let localConfig = (await load(configFilePath)) as
| Partial<EleventyConfig>
| ((arg: DummyEleventyConfig) => Promise<Partial<EleventyConfig>>);
if (!localConfig) return [];
if (!localConfig) return PRODUCTION_ENTRY_FILE_PATTERNS.map(toProductionEntryPattern);
if (typeof localConfig === 'function') localConfig = await localConfig(new DummyEleventyConfig());

const inputDir = localConfig?.dir?.input || defaultEleventyConfig.dir.input;
Expand Down

0 comments on commit a00ad70

Please sign in to comment.