@@ -11,7 +11,6 @@ exports.buildWebpackBrowser = exports.getCompilerConfig = exports.getAnalyticsCo
11
11
const architect_1 = require ( "@angular-devkit/architect" ) ;
12
12
const build_webpack_1 = require ( "@angular-devkit/build-webpack" ) ;
13
13
const core_1 = require ( "@angular-devkit/core" ) ;
14
- const node_1 = require ( "@angular-devkit/core/node" ) ;
15
14
const fs = require ( "fs" ) ;
16
15
const path = require ( "path" ) ;
17
16
const rxjs_1 = require ( "rxjs" ) ;
@@ -63,7 +62,7 @@ function getCompilerConfig(wco) {
63
62
return { } ;
64
63
}
65
64
exports . getCompilerConfig = getCompilerConfig ;
66
- async function initialize ( options , context , host , differentialLoadingNeeded , webpackConfigurationTransform ) {
65
+ async function initialize ( options , context , differentialLoadingNeeded , webpackConfigurationTransform ) {
67
66
var _a , _b ;
68
67
const originalOutputPath = options . outputPath ;
69
68
// Assets are processed directly by the builder except when watching
@@ -76,10 +75,10 @@ async function initialize(options, context, host, differentialLoadingNeeded, web
76
75
getAnalyticsConfig ( wco , context ) ,
77
76
getCompilerConfig ( wco ) ,
78
77
wco . buildOptions . webWorkerTsConfig ? configs_1 . getWorkerConfig ( wco ) : { } ,
79
- ] , host , { differentialLoadingNeeded } ) ;
78
+ ] , { differentialLoadingNeeded } ) ;
80
79
// Validate asset option values if processed directly
81
80
if ( ( ( _a = options . assets ) === null || _a === void 0 ? void 0 : _a . length ) && ! ( ( _b = adjustedOptions . assets ) === null || _b === void 0 ? void 0 : _b . length ) ) {
82
- utils_1 . normalizeAssetPatterns ( options . assets , new core_1 . virtualFs . SyncDelegateHost ( host ) , core_1 . normalize ( context . workspaceRoot ) , core_1 . normalize ( projectRoot ) , projectSourceRoot === undefined ? undefined : core_1 . normalize ( projectSourceRoot ) ) . forEach ( ( { output } ) => {
81
+ utils_1 . normalizeAssetPatterns ( options . assets , core_1 . normalize ( context . workspaceRoot ) , core_1 . normalize ( projectRoot ) , projectSourceRoot === undefined ? undefined : core_1 . normalize ( projectSourceRoot ) ) . forEach ( ( { output } ) => {
83
82
if ( output . startsWith ( '..' ) ) {
84
83
throw new Error ( 'An asset cannot be written to a location outside of the output path.' ) ;
85
84
}
@@ -97,7 +96,6 @@ async function initialize(options, context, host, differentialLoadingNeeded, web
97
96
// tslint:disable-next-line: no-big-function
98
97
function buildWebpackBrowser ( options , context , transforms = { } ) {
99
98
var _a ;
100
- const host = new node_1 . NodeJsSyncHost ( ) ;
101
99
const root = core_1 . normalize ( context . workspaceRoot ) ;
102
100
const projectName = ( _a = context . target ) === null || _a === void 0 ? void 0 : _a . project ;
103
101
if ( ! projectName ) {
@@ -132,7 +130,7 @@ function buildWebpackBrowser(options, context, transforms = {}) {
132
130
'\nFor additional information: https://v10.angular.io/guide/deprecations#ie-9-10-and-mobile' ) ;
133
131
}
134
132
return {
135
- ...( await initialize ( options , context , host , isDifferentialLoadingNeeded , transforms . webpackConfiguration ) ) ,
133
+ ...( await initialize ( options , context , isDifferentialLoadingNeeded , transforms . webpackConfiguration ) ) ,
136
134
buildBrowserFeatures,
137
135
isDifferentialLoadingNeeded,
138
136
target,
@@ -459,7 +457,7 @@ function buildWebpackBrowser(options, context, transforms = {}) {
459
457
if ( ! options . watch && ( ( _d = options . assets ) === null || _d === void 0 ? void 0 : _d . length ) ) {
460
458
spinner . start ( 'Copying assets...' ) ;
461
459
try {
462
- await copy_assets_1 . copyAssets ( utils_1 . normalizeAssetPatterns ( options . assets , new core_1 . virtualFs . SyncDelegateHost ( host ) , root , core_1 . normalize ( projectRoot ) , projectSourceRoot === undefined ? undefined : core_1 . normalize ( projectSourceRoot ) ) , Array . from ( outputPaths . values ( ) ) , context . workspaceRoot ) ;
460
+ await copy_assets_1 . copyAssets ( utils_1 . normalizeAssetPatterns ( options . assets , root , core_1 . normalize ( projectRoot ) , projectSourceRoot === undefined ? undefined : core_1 . normalize ( projectSourceRoot ) ) , Array . from ( outputPaths . values ( ) ) , context . workspaceRoot ) ;
463
461
spinner . succeed ( 'Copying assets complete.' ) ;
464
462
}
465
463
catch ( err ) {
@@ -517,7 +515,7 @@ function buildWebpackBrowser(options, context, transforms = {}) {
517
515
spinner . start ( 'Generating service worker...' ) ;
518
516
for ( const [ locale , outputPath ] of outputPaths . entries ( ) ) {
519
517
try {
520
- await service_worker_1 . augmentAppWithServiceWorker ( host , root , core_1 . normalize ( projectRoot ) , core_1 . normalize ( outputPath ) , getLocaleBaseHref ( i18n , locale ) || options . baseHref || '/' , options . ngswConfigPath ) ;
518
+ await service_worker_1 . augmentAppWithServiceWorker ( root , core_1 . normalize ( projectRoot ) , core_1 . normalize ( outputPath ) , getLocaleBaseHref ( i18n , locale ) || options . baseHref || '/' , options . ngswConfigPath ) ;
521
519
}
522
520
catch ( error ) {
523
521
spinner . fail ( 'Service worker generation failed.' ) ;
0 commit comments