fix: exclude App_Resources from context

fixes #9299
This commit is contained in:
Igor Randjelovic
2021-04-05 15:27:12 +02:00
parent d8067a553f
commit 13b3364e62

View File

@ -1,4 +1,8 @@
import { DefinePlugin, HotModuleReplacementPlugin } from 'webpack';
import {
ContextExclusionPlugin,
DefinePlugin,
HotModuleReplacementPlugin,
} from 'webpack';
import Config from 'webpack-chain';
import { resolve } from 'path';
@ -280,6 +284,12 @@ export default function (config: Config, env: IWebpackEnv = _env): Config {
},
]);
// Makes sure that require.context will never include
// App_Resources, regardless where they are located.
config
.plugin('ContextExclusionPlugin|App_Resources')
.use(ContextExclusionPlugin, [new RegExp(`(.*)App_Resources(.*)`)]);
// Filter common undesirable warnings
config.set(
'ignoreWarnings',