Skip to content

Commit

Permalink
fix(@angular-devkit/build-angular): fix check for absolute paths in w…
Browse files Browse the repository at this point in the history
…indows 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
  • Loading branch information
Alan authored and vikerman committed Mar 11, 2019
1 parent 4a1e9f9 commit 44085ec
Showing 1 changed file with 2 additions and 1 deletion.
Expand Up @@ -5,6 +5,7 @@
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
import { isAbsolute } from 'path';
import { Configuration } from 'webpack';
import { WebpackConfigOptions } from '../build-options';
import { getSourceMapDevTool } from './utils';
Expand Down Expand Up @@ -38,7 +39,7 @@ export function getServerConfig(wco: WebpackConfigOptions) {
/^@angular/,
(context: string, request: string, callback: (error?: null, result?: string) => void) => {
// Absolute & Relative paths are not externals
if (request.match(/^\.{0,2}\//)) {
if (/^\.{0,2}\//.test(request) || isAbsolute(request)) {
return callback();
}

Expand Down

0 comments on commit 44085ec

Please sign in to comment.