Skip to content
This repository was archived by the owner on Jan 11, 2023. It is now read-only.

Commit 4449338

Browse files
committed
IE 11 support
1 parent cfa5a42 commit 4449338

File tree

3 files changed

+11
-11
lines changed

3 files changed

+11
-11
lines changed

package-lock.json

+3-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
"dependencies": {
2222
"html-minifier": "^4.0.0",
2323
"http-link-header": "^1.0.2",
24-
"shimport": "^1.0.1",
24+
"shimport": "^2.0.3",
2525
"source-map": "^0.6.1",
2626
"sourcemap-codec": "^1.4.6",
2727
"string-hash": "^1.1.3"

src/core/create_compilers/RollupCompiler.ts

+7-7
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@ const stderr = console.error.bind(console);
1919
let rollup: any;
2020

2121
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 + '"]');
2626
if (!link) {
2727
link = document.createElement('link');
2828
link.rel = 'stylesheet';
@@ -32,10 +32,10 @@ export default files => {
3232
if (link.sheet) {
3333
fulfil();
3434
} else {
35-
link.onload = () => fulfil();
35+
link.onload = function() { return fulfil() };
3636
link.onerror = reject;
3737
}
38-
})));
38+
})}));
3939
};`.trim();
4040

4141
const get_entry_point_output_chunk = (bundle: OutputBundle, entry_point?: string) => {
@@ -130,7 +130,7 @@ export default class RollupCompiler {
130130
if (targetModuleId) {
131131
return {
132132
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]; })`
134134
};
135135
} else {
136136
return {

0 commit comments

Comments
 (0)