@@ -85,44 +85,43 @@ function getTransforms(
8585const cordovaServeTransform : (
8686 formattedAssets : FormattedAssets ,
8787 context : BuilderContext ,
88- ) => ExecutionTransformer < Configuration > = (
89- formattedAssets ,
90- { workspaceRoot } ,
91- ) => browserWebpackConfig => {
92- const scriptExtras = formattedAssets . globalScriptsByBundleName . map (
93- ( script : { bundleName : any ; paths : any } ) => {
94- const bundleName = script . bundleName ;
95- return new ScriptsWebpackPlugin ( {
96- name : bundleName ,
97- sourceMap : true ,
98- filename : `${ basename ( bundleName ) } .js` ,
99- scripts : script . paths ,
100- basePath : workspaceRoot ,
101- } ) ;
102- } ,
103- ) ;
88+ ) => ExecutionTransformer < Configuration > =
89+ ( formattedAssets , { workspaceRoot } ) =>
90+ browserWebpackConfig => {
91+ const scriptExtras = formattedAssets . globalScriptsByBundleName . map (
92+ ( script : { bundleName : any ; paths : any } ) => {
93+ const bundleName = script . bundleName ;
94+ return new ScriptsWebpackPlugin ( {
95+ name : bundleName ,
96+ sourceMap : true ,
97+ filename : `${ basename ( bundleName ) } .js` ,
98+ scripts : script . paths ,
99+ basePath : workspaceRoot ,
100+ } ) ;
101+ } ,
102+ ) ;
104103
105- const copyWebpackPluginInstance = new CopyWebpackPlugin ( {
106- patterns : formattedAssets . copyWebpackPluginPatterns ,
107- } ) ;
104+ const copyWebpackPluginInstance = new CopyWebpackPlugin ( {
105+ patterns : formattedAssets . copyWebpackPluginPatterns ,
106+ } ) ;
108107
109- // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
110- browserWebpackConfig . plugins ! . push (
111- ...scriptExtras ,
112- copyWebpackPluginInstance ,
113- ) ;
114- return browserWebpackConfig ;
115- } ;
108+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
109+ browserWebpackConfig . plugins ! . push (
110+ ...scriptExtras ,
111+ copyWebpackPluginInstance ,
112+ ) ;
113+ return browserWebpackConfig ;
114+ } ;
116115
117116export const indexHtmlTransformFactory : (
118117 formattedAssets : FormattedAssets ,
119118 context : BuilderContext ,
120- ) => IndexHtmlTransform = ( { globalScriptsByBundleName } ) => (
121- indexTransform : string ,
122- ) => {
123- const augmentedHtml = augmentIndexHtml (
124- indexTransform ,
125- globalScriptsByBundleName ,
126- ) ;
127- return Promise . resolve ( augmentedHtml ) ;
128- } ;
119+ ) => IndexHtmlTransform =
120+ ( { globalScriptsByBundleName } ) =>
121+ ( indexTransform : string ) => {
122+ const augmentedHtml = augmentIndexHtml (
123+ indexTransform ,
124+ globalScriptsByBundleName ,
125+ ) ;
126+ return Promise . resolve ( augmentedHtml ) ;
127+ } ;
0 commit comments