Skip to content

Commit 42df2c8

Browse files
committed
fix pathing in Windows
1 parent d6fbf39 commit 42df2c8

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

packages/webpack/src/loader.ts

+4-3
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,12 @@ function _removeDecorators(fileName: string, source: string): string {
2727

2828

2929
function _replaceBootstrap(fileName: string, source: string, plugin: NgcWebpackPlugin) {
30-
const basePath = plugin.angularCompilerOptions.basePath;
31-
const entryModuleFileName = plugin.entryModule.split('#')[0] + '.ngfactory';
30+
const basePath = path.normalize(plugin.angularCompilerOptions.basePath);
31+
const entryModuleFileName = path.normalize(plugin.entryModule.split('#')[0] + '.ngfactory');
3232
const relativeEntryModulePath = path.relative(basePath, entryModuleFileName);
3333
const fullEntryModulePath = path.resolve(plugin.genDir, relativeEntryModulePath);
34-
const ngFactoryPath = './' + path.relative(path.dirname(fileName), fullEntryModulePath);
34+
const relativeNgFactoryPath = path.relative(path.dirname(fileName), fullEntryModulePath);
35+
const ngFactoryPath = './' + relativeNgFactoryPath.replace(/\\/g, '/');
3536

3637
return source
3738
.replace(/(import.*)\bplatformBrowserDynamic\b(.*\/)platform-browser-dynamic(\b.*)$/m,

0 commit comments

Comments
 (0)