File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -27,11 +27,14 @@ function _removeDecorators(fileName: string, source: string): string {
27
27
28
28
29
29
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 genDir = path . normalize ( plugin . genDir ) ;
32
+ const dirName = path . normalize ( path . dirname ( fileName ) ) ;
33
+ const entryModuleFileName = path . normalize ( plugin . entryModule . split ( '#' ) [ 0 ] + '.ngfactory' ) ;
32
34
const relativeEntryModulePath = path . relative ( basePath , entryModuleFileName ) ;
33
- const fullEntryModulePath = path . resolve ( plugin . genDir , relativeEntryModulePath ) ;
34
- const ngFactoryPath = './' + path . relative ( path . dirname ( fileName ) , fullEntryModulePath ) ;
35
+ const fullEntryModulePath = path . resolve ( genDir , relativeEntryModulePath ) ;
36
+ const relativeNgFactoryPath = path . relative ( dirName , fullEntryModulePath ) ;
37
+ const ngFactoryPath = './' + relativeNgFactoryPath . replace ( / \\ / g, '/' ) ;
35
38
36
39
return source
37
40
. replace ( / ( i m p o r t .* ) \b p l a t f o r m B r o w s e r D y n a m i c \b ( .* \/ ) p l a t f o r m - b r o w s e r - d y n a m i c ( \b .* ) $ / m,
You can’t perform that action at this time.
0 commit comments