From a00ad707d766f38a548c058235de227881d9f110 Mon Sep 17 00:00:00 2001 From: uncenter <47499684+uncenter@users.noreply.github.com> Date: Wed, 17 Jan 2024 13:54:16 -0500 Subject: [PATCH] Default to production entry file patterns --- packages/knip/src/plugins/eleventy/index.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/knip/src/plugins/eleventy/index.ts b/packages/knip/src/plugins/eleventy/index.ts index 735f7bd99..d349e323a 100644 --- a/packages/knip/src/plugins/eleventy/index.ts +++ b/packages/knip/src/plugins/eleventy/index.ts @@ -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'; @@ -26,7 +26,7 @@ const findEleventyDependencies: GenericPluginCallback = async (configFilePath, o let localConfig = (await load(configFilePath)) as | Partial | ((arg: DummyEleventyConfig) => Promise>); - 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;