Skip to content

Commit f393b09

Browse files
committed
refactor(@angular-devkit/build-angular): disable requireContext parsing
`require.context` is a webpack specific feature which was only needed to support the old Karma test setup. BREAKING CHANGE: `require.context` are no longer parsed. Webpack specific features are not supported nor guaranteed to work in the future.
1 parent 766d4a0 commit f393b09

File tree

1 file changed

+1
-2
lines changed
  • packages/angular_devkit/build_angular/src/webpack/configs

1 file changed

+1
-2
lines changed

Diff for: packages/angular_devkit/build_angular/src/webpack/configs/common.ts

+1-2
Original file line numberDiff line numberDiff line change
@@ -342,8 +342,7 @@ export async function getCommonConfig(wco: WebpackConfigOptions): Promise<Config
342342
strictExportPresence: true,
343343
parser: {
344344
javascript: {
345-
// TODO(alanagius): disable the below once we have a migration to remove `require.context` from test.ts file in users projects.
346-
requireContext: true,
345+
requireContext: false,
347346
// Disable auto URL asset module creation. This doesn't effect `new Worker(new URL(...))`
348347
// https://webpack.js.org/guides/asset-modules/#url-assets
349348
url: false,

0 commit comments

Comments
 (0)