@@ -19,10 +19,10 @@ const stderr = console.error.bind(console);
19
19
let rollup : any ;
20
20
21
21
const inject_styles = `
22
- export default files => {
23
- return Promise.all(files.map(file => new Promise((fulfil, reject) => {
24
- const href = new URL(file, import.meta.url);
25
- let link = document.querySelector('link[rel=stylesheet][href="' + href + '"]');
22
+ export default function( files) {
23
+ return Promise.all(files.map(function( file) { return new Promise(function (fulfil, reject) {
24
+ var href = new URL(file, import.meta.url);
25
+ var link = document.querySelector('link[rel=stylesheet][href="' + href + '"]');
26
26
if (!link) {
27
27
link = document.createElement('link');
28
28
link.rel = 'stylesheet';
@@ -32,10 +32,10 @@ export default files => {
32
32
if (link.sheet) {
33
33
fulfil();
34
34
} else {
35
- link.onload = () => fulfil();
35
+ link.onload = function () { return fulfil() } ;
36
36
link.onerror = reject;
37
37
}
38
- })));
38
+ })} ));
39
39
};` . trim ( ) ;
40
40
41
41
const get_entry_point_output_chunk = ( bundle : OutputBundle , entry_point ?: string ) => {
@@ -130,7 +130,7 @@ export default class RollupCompiler {
130
130
if ( targetModuleId ) {
131
131
return {
132
132
left : 'Promise.all([import(' ,
133
- right : `), ___SAPPER_CSS_INJECTION___${ Buffer . from ( targetModuleId ) . toString ( 'hex' ) } ___]).then(x => x[0])`
133
+ right : `), ___SAPPER_CSS_INJECTION___${ Buffer . from ( targetModuleId ) . toString ( 'hex' ) } ___]).then(function(x) { return x[0]; } )`
134
134
} ;
135
135
} else {
136
136
return {
0 commit comments