@@ -6,7 +6,6 @@ import type {
6
6
DevServerBuilderOptions ,
7
7
DevServerBuilderOutput ,
8
8
} from '@angular-devkit/build-angular' ;
9
- import type { IndexHtmlTransform } from '@angular-devkit/build-angular/src/utils/index-file/index-html-generator' ;
10
9
import { ScriptsWebpackPlugin } from '@angular-devkit/build-angular/src/tools/webpack/plugins' ;
11
10
import type { json } from '@angular-devkit/core' ;
12
11
import * as CopyWebpackPlugin from 'copy-webpack-plugin' ;
@@ -74,33 +73,33 @@ const cordovaServeTransform: (
74
73
context : BuilderContext
75
74
) => ExecutionTransformer < Configuration > =
76
75
( formattedAssets , { workspaceRoot } ) =>
77
- ( browserWebpackConfig ) => {
78
- const scriptExtras = formattedAssets . globalScriptsByBundleName . map ( ( script : { bundleName : any ; paths : any } ) => {
79
- const bundleName = script . bundleName ;
80
- return new ScriptsWebpackPlugin ( {
81
- name : bundleName ,
82
- sourceMap : true ,
83
- filename : `${ basename ( bundleName ) } .js` ,
84
- scripts : script . paths ,
85
- basePath : workspaceRoot ,
76
+ ( browserWebpackConfig ) => {
77
+ const scriptExtras = formattedAssets . globalScriptsByBundleName . map ( ( script : { bundleName : any ; paths : any } ) => {
78
+ const bundleName = script . bundleName ;
79
+ return new ScriptsWebpackPlugin ( {
80
+ name : bundleName ,
81
+ sourceMap : true ,
82
+ filename : `${ basename ( bundleName ) } .js` ,
83
+ scripts : script . paths ,
84
+ basePath : workspaceRoot ,
85
+ } ) ;
86
86
} ) ;
87
- } ) ;
88
87
89
- const copyWebpackPluginInstance = new CopyWebpackPlugin ( {
90
- patterns : formattedAssets . copyWebpackPluginPatterns ,
91
- } ) ;
88
+ const copyWebpackPluginInstance = new CopyWebpackPlugin ( {
89
+ patterns : formattedAssets . copyWebpackPluginPatterns ,
90
+ } ) ;
92
91
93
- // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
94
- ( browserWebpackConfig . plugins as any ) ?. push ( ...scriptExtras , copyWebpackPluginInstance ) ;
95
- return browserWebpackConfig ;
96
- } ;
92
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
93
+ ( browserWebpackConfig . plugins as any ) ?. push ( ...scriptExtras , copyWebpackPluginInstance ) ;
94
+ return browserWebpackConfig ;
95
+ } ;
97
96
98
97
export const indexHtmlTransformFactory : (
99
98
formattedAssets : FormattedAssets ,
100
99
context : BuilderContext
101
- ) => IndexHtmlTransform =
100
+ ) => ( content : string ) => Promise < string > =
102
101
( { globalScriptsByBundleName } ) =>
103
- ( indexTransform : string ) => {
104
- const augmentedHtml = augmentIndexHtml ( indexTransform , globalScriptsByBundleName ) ;
105
- return Promise . resolve ( augmentedHtml ) ;
106
- } ;
102
+ ( indexTransform : string ) => {
103
+ const augmentedHtml = augmentIndexHtml ( indexTransform , globalScriptsByBundleName ) ;
104
+ return Promise . resolve ( augmentedHtml ) ;
105
+ } ;
0 commit comments