File tree Expand file tree Collapse file tree 1 file changed +18
-7
lines changed Expand file tree Collapse file tree 1 file changed +18
-7
lines changed Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ type Options = {
1717 publicPath ?: string ;
1818 context ?: Context ;
1919 template ?: (
20- args : Context | { css : string ; js : string ; publicPath : string }
20+ args : Context & Files & { publicPath : string }
2121 ) => string | Promise < string > ;
2222 chunks ?: string [ ] ;
2323} ;
@@ -76,8 +76,12 @@ function generateCSSReferences({
7676} : {
7777 files : string [ ] ;
7878 publicPath : string ;
79- attributes : { rel ?: string } ;
80- } ) {
79+ attributes : ( Attributes & { rel ?: string } ) | undefined ;
80+ } ) : string {
81+ if ( ! attributes ) {
82+ return '' ;
83+ }
84+
8185 const allAttributes = {
8286 ...attributes ,
8387 rel : 'rel' in attributes ? attributes . rel : 'stylesheet' ,
@@ -95,11 +99,18 @@ function generateJSReferences({
9599 files = [ ] ,
96100 publicPath = '' ,
97101 attributes = { } ,
98- } ) {
99- attributes = generateAttributes ( attributes ) ;
100-
102+ } : {
103+ files : string [ ] ;
104+ publicPath : string ;
105+ attributes : Attributes ;
106+ } ) : string {
101107 return files
102- . map ( ( file ) => `<script src="${ publicPath } ${ file } "${ attributes } ></script>` )
108+ . map (
109+ ( file ) =>
110+ `<script src="${ publicPath } ${ file } "${ generateAttributes (
111+ attributes
112+ ) } ></script>`
113+ )
103114 . join ( '' ) ;
104115}
105116
You can’t perform that action at this time.
0 commit comments