Skip to content

Commit 901042d

Browse files
Alanvikerman
Alan
authored andcommitted
fix(@angular-devkit/build-angular): fix check for absolute paths in windows in server config
This changes fixes `Error: You must pass in a NgModule or NgModuleFactory to be bootstrapped`. At the moment the check for absolute path is not correct for windows. Fixes #13865 and fixes angular/universal#1139
1 parent d841b37 commit 901042d

File tree

1 file changed

+2
-1
lines changed
  • packages/angular_devkit/build_angular/src/angular-cli-files/models/webpack-configs

1 file changed

+2
-1
lines changed

packages/angular_devkit/build_angular/src/angular-cli-files/models/webpack-configs/server.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
* Use of this source code is governed by an MIT-style license that can be
66
* found in the LICENSE file at https://angular.io/license
77
*/
8+
import { isAbsolute } from 'path';
89
import { Configuration } from 'webpack';
910
import { WebpackConfigOptions } from '../build-options';
1011
import { getSourceMapDevTool } from './utils';
@@ -38,7 +39,7 @@ export function getServerConfig(wco: WebpackConfigOptions) {
3839
/^@angular/,
3940
(context: string, request: string, callback: (error?: null, result?: string) => void) => {
4041
// Absolute & Relative paths are not externals
41-
if (request.match(/^\.{0,2}\//)) {
42+
if (/^\.{0,2}\//.test(request) || isAbsolute(request)) {
4243
return callback();
4344
}
4445

0 commit comments

Comments
 (0)