@@ -517,21 +517,19 @@ class HtmlWebpackPlugin {
517
517
// Make tags self-closing in case of xhtml
518
518
// Turn { "viewport" : "width=500, initial-scale=1" } into
519
519
// [{ name:"viewport" content:"width=500, initial-scale=1" }]
520
- const selfClosingTag = ! ! this . options . xhtml ;
521
- const metaTagAttributeObjects = Object . keys ( this . options . meta ) . map ( ( metaName ) => {
522
- const metaTagContent = this . options . meta [ metaName ] ;
523
- return ( typeof metaTagContent === 'object' ) ? metaTagContent : {
520
+ const metaTagAttributeObjects = Object . keys ( metaOptions ) . map ( ( metaName ) => {
521
+ const metaTagContent = metaOptions [ metaName ] ;
522
+ return ( typeof metaTagContent === 'string' ) ? {
524
523
name : metaName ,
525
524
content : metaTagContent
526
- } ;
525
+ } : metaTagContent ;
527
526
} ) ;
528
527
// Turn [{ name:"viewport" content:"width=500, initial-scale=1" }] into
529
528
// the html-webpack-plugin tag structure
530
529
return metaTagAttributeObjects . map ( ( metaTagAttributes ) => {
531
530
return {
532
531
tagName : 'meta' ,
533
532
voidTag : true ,
534
- selfClosingTag : selfClosingTag ,
535
533
attributes : metaTagAttributes
536
534
} ;
537
535
} ) ;
@@ -552,22 +550,19 @@ class HtmlWebpackPlugin {
552
550
body: HtmlTagObject[]
553
551
}}
554
552
*/
555
- generateHtmlTags ( assets ) {
553
+ generateHtmlTagObjects ( assets ) {
556
554
// Turn script files into script tags
557
555
const scripts = assets . js . map ( scriptPath => ( {
558
556
tagName : 'script' ,
559
- closeTag : true ,
557
+ voidTag : false ,
560
558
attributes : {
561
559
type : 'text/javascript' ,
562
560
src : scriptPath
563
561
}
564
562
} ) ) ;
565
- // Make tags self-closing in case of xhtml
566
- const selfClosingTag = ! ! this . options . xhtml ;
567
563
// Turn css files into link tags
568
564
const styles = assets . css . map ( stylePath => ( {
569
565
tagName : 'link' ,
570
- selfClosingTag : selfClosingTag ,
571
566
voidTag : true ,
572
567
attributes : {
573
568
href : stylePath ,
@@ -582,7 +577,6 @@ class HtmlWebpackPlugin {
582
577
if ( assets . favicon ) {
583
578
head . push ( {
584
579
tagName : 'link' ,
585
- selfClosingTag : selfClosingTag ,
586
580
voidTag : true ,
587
581
attributes : {
588
582
rel : 'shortcut icon' ,
0 commit comments