@@ -19,8 +19,7 @@ export interface GetOutputHTMLParams {
1919 emittedAssets : EmittedAssets ;
2020 pluginOptions : RollupPluginHTMLOptions ;
2121 entrypointBundles : Record < string , EntrypointBundle > ;
22- inputExternalTransformHtmlFns ?: TransformHtmlFunction [ ] ;
23- outputExternalTransformHtmlFns ?: TransformHtmlFunction [ ] ;
22+ externalTransformHtmlFns ?: TransformHtmlFunction [ ] ;
2423 defaultInjectDisabled : boolean ;
2524 serviceWorkerPath : string ;
2625 injectServiceWorker : boolean ;
@@ -32,8 +31,7 @@ export async function getOutputHTML(params: GetOutputHTMLParams) {
3231 const {
3332 pluginOptions,
3433 entrypointBundles,
35- inputExternalTransformHtmlFns,
36- outputExternalTransformHtmlFns,
34+ externalTransformHtmlFns,
3735 input,
3836 outputDir,
3937 emittedAssets,
@@ -46,20 +44,8 @@ export async function getOutputHTML(params: GetOutputHTMLParams) {
4644 const { default : defaultBundle , ...multiBundles } = entrypointBundles ;
4745 const { absoluteSocialMediaUrls = true , rootDir = process . cwd ( ) } = pluginOptions ;
4846
49- let inputHtml = input . html ;
50-
51- // run transform functions on input HTML
52- const inputTransforms = [ ...( inputExternalTransformHtmlFns ?? [ ] ) ] ;
53- for ( const transform of inputTransforms ) {
54- inputHtml = await transform ( inputHtml , {
55- bundle : defaultBundle ,
56- bundles : multiBundles ,
57- htmlFileName : input . name ,
58- } ) ;
59- }
60-
6147 // inject rollup output into HTML
62- let document = parse ( inputHtml ) ;
48+ let document = parse ( input . html ) ;
6349 if ( pluginOptions . extractAssets !== false ) {
6450 injectedUpdatedAssetPaths ( {
6551 document,
@@ -89,17 +75,17 @@ export async function getOutputHTML(params: GetOutputHTMLParams) {
8975
9076 let outputHtml = serialize ( document ) ;
9177
92- const outputTransforms = [ ...( outputExternalTransformHtmlFns ?? [ ] ) ] ;
78+ const transforms = [ ...( externalTransformHtmlFns ?? [ ] ) ] ;
9379 if ( pluginOptions . transformHtml ) {
9480 if ( Array . isArray ( pluginOptions . transformHtml ) ) {
95- outputTransforms . push ( ...pluginOptions . transformHtml ) ;
81+ transforms . push ( ...pluginOptions . transformHtml ) ;
9682 } else {
97- outputTransforms . push ( pluginOptions . transformHtml ) ;
83+ transforms . push ( pluginOptions . transformHtml ) ;
9884 }
9985 }
10086
10187 // run transform functions on output HTML
102- for ( const transform of outputTransforms ) {
88+ for ( const transform of transforms ) {
10389 outputHtml = await transform ( outputHtml , {
10490 bundle : defaultBundle ,
10591 bundles : multiBundles ,
0 commit comments