@@ -6,7 +6,6 @@ import type {
66 DevServerBuilderOptions ,
77 DevServerBuilderOutput ,
88} from '@angular-devkit/build-angular' ;
9- import type { IndexHtmlTransform } from '@angular-devkit/build-angular/src/utils/index-file/index-html-generator' ;
109import { ScriptsWebpackPlugin } from '@angular-devkit/build-angular/src/tools/webpack/plugins' ;
1110import type { json } from '@angular-devkit/core' ;
1211import * as CopyWebpackPlugin from 'copy-webpack-plugin' ;
@@ -74,33 +73,33 @@ const cordovaServeTransform: (
7473 context : BuilderContext
7574) => ExecutionTransformer < Configuration > =
7675 ( 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+ } ) ;
8686 } ) ;
87- } ) ;
8887
89- const copyWebpackPluginInstance = new CopyWebpackPlugin ( {
90- patterns : formattedAssets . copyWebpackPluginPatterns ,
91- } ) ;
88+ const copyWebpackPluginInstance = new CopyWebpackPlugin ( {
89+ patterns : formattedAssets . copyWebpackPluginPatterns ,
90+ } ) ;
9291
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+ } ;
9796
9897export const indexHtmlTransformFactory : (
9998 formattedAssets : FormattedAssets ,
10099 context : BuilderContext
101- ) => IndexHtmlTransform =
100+ ) => ( content : string ) => Promise < string > =
102101 ( { 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