Skip to content

Commit

Permalink
feat(@angular-devkit/build-angular): ignore express and hapi depedenc…
Browse files Browse the repository at this point in the history
…y expresstion (#15586)

In version 9 universal express and hapi `server.ts` will be bundled using the CLI server builder.

We need to add this to avoid `the request of a dependency is an expression` warnings

See: angular/universal#1237
  • Loading branch information
alan-agius4 authored and mgechev committed Sep 12, 2019
1 parent 35a0145 commit 1ea4a5f
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* found in the LICENSE file at https://angular.io/license
*/
import { isAbsolute } from 'path';
import { Configuration } from 'webpack';
import { Configuration, ContextReplacementPlugin } from 'webpack';
import { WebpackConfigOptions } from '../build-options';
import { getSourceMapDevTool } from './utils';

Expand All @@ -30,7 +30,12 @@ export function getServerConfig(wco: WebpackConfigOptions): Configuration {
output: {
libraryTarget: 'commonjs',
},
plugins: extraPlugins,
plugins: [
// Fixes Critical dependency: the request of a dependency is an expression
new ContextReplacementPlugin(/@?hapi(\\|\/)/),
new ContextReplacementPlugin(/express(\\|\/)/),
...extraPlugins,
],
node: false,
};

Expand Down

0 comments on commit 1ea4a5f

Please sign in to comment.