From ef00b434efcb38dbcaf81398fc69a69a5e8ce365 Mon Sep 17 00:00:00 2001 From: Igor Randjelovic Date: Mon, 5 Apr 2021 15:28:08 +0200 Subject: [PATCH] chore: rename exclusion --- packages/webpack5/src/helpers/virtualModules.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/webpack5/src/helpers/virtualModules.ts b/packages/webpack5/src/helpers/virtualModules.ts index ef6c478ac..8fc671ec2 100644 --- a/packages/webpack5/src/helpers/virtualModules.ts +++ b/packages/webpack5/src/helpers/virtualModules.ts @@ -25,8 +25,11 @@ export function addVirtualModule( ): string { const virtualEntryPath = join(getEntryDirPath(), `${name}`); + // add the virtual entry to the context exclusions + // makes sure that require.context will never + // include the virtual entry. config - .plugin('ContextExclusionPluginPlugin') + .plugin(`ContextExclusionPlugin|${name}`) .use(ContextExclusionPlugin, [new RegExp(`${name}\.js$`)]); const options = {