This repository was archived by the owner on Nov 22, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +10
-8
lines changed Expand file tree Collapse file tree 2 files changed +10
-8
lines changed Original file line number Diff line number Diff line change @@ -15,7 +15,6 @@ import {
1515import { BrowserBuilderOptions } from '@angular-devkit/build-angular' ;
1616import { normalizeOptimization } from '@angular-devkit/build-angular/src/utils/normalize-optimization' ;
1717import { augmentAppWithServiceWorker } from '@angular-devkit/build-angular/src/utils/service-worker' ;
18- import { normalize , resolve as resolvePath } from '@angular-devkit/core' ;
1918import * as fs from 'fs' ;
2019import ora from 'ora' ;
2120import * as path from 'path' ;
@@ -92,9 +91,11 @@ async function _renderUniversal(
9291 throw new Error ( 'The builder requires a target.' ) ;
9392 }
9493
95- const root = normalize ( context . workspaceRoot ) ;
9694 const projectMetadata = await context . getProjectMetadata ( projectName ) ;
97- const projectRoot = resolvePath ( root , normalize ( ( projectMetadata . root as string ) || '' ) ) ;
95+ const projectRoot = path . join (
96+ context . workspaceRoot ,
97+ ( projectMetadata . root as string | undefined ) ?? '' ,
98+ ) ;
9899
99100 // Users can specify a different base html file e.g. "src/home.html"
100101 const indexFile = getIndexOutputFile ( browserOptions ) ;
@@ -160,7 +161,7 @@ async function _renderUniversal(
160161 await augmentAppWithServiceWorker (
161162 projectRoot ,
162163 context . workspaceRoot ,
163- normalize ( outputPath ) ,
164+ outputPath ,
164165 browserOptions . baseHref || '/' ,
165166 browserOptions . ngswConfigPath ,
166167 ) ;
Original file line number Diff line number Diff line change @@ -15,7 +15,6 @@ import {
1515import { BrowserBuilderOptions , BrowserBuilderOutput } from '@angular-devkit/build-angular' ;
1616import { normalizeOptimization } from '@angular-devkit/build-angular/src/utils/normalize-optimization' ;
1717import { augmentAppWithServiceWorker } from '@angular-devkit/build-angular/src/utils/service-worker' ;
18- import { normalize , resolve } from '@angular-devkit/core' ;
1918import express from 'express' ;
2019import * as http from 'http' ;
2120import ora from 'ora' ;
@@ -145,14 +144,16 @@ async function generateServiceWorker(
145144 throw new Error ( 'The builder requires a target.' ) ;
146145 }
147146
148- const root = normalize ( context . workspaceRoot ) ;
149147 const projectMetadata = await context . getProjectMetadata ( projectName ) ;
150- const projectRoot = resolve ( root , normalize ( ( projectMetadata . root as string ) ?? '' ) ) ;
148+ const projectRoot = path . join (
149+ context . workspaceRoot ,
150+ ( projectMetadata . root as string | undefined ) ?? '' ,
151+ ) ;
151152
152153 await augmentAppWithServiceWorker (
153154 projectRoot ,
154155 context . workspaceRoot ,
155- normalize ( outputPath ) ,
156+ outputPath ,
156157 browserOptions . baseHref || '/' ,
157158 browserOptions . ngswConfigPath ,
158159 ) ;
You can’t perform that action at this time.
0 commit comments