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

Commit

Permalink
IE 11 support
Browse files Browse the repository at this point in the history
  • Loading branch information
benmccann committed Sep 18, 2020
1 parent cfa5a42 commit 4449338
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
6 changes: 3 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -21,7 +21,7 @@
"dependencies": {
"html-minifier": "^4.0.0",
"http-link-header": "^1.0.2",
"shimport": "^1.0.1",
"shimport": "^2.0.3",
"source-map": "^0.6.1",
"sourcemap-codec": "^1.4.6",
"string-hash": "^1.1.3"
Expand Down
14 changes: 7 additions & 7 deletions src/core/create_compilers/RollupCompiler.ts
Expand Up @@ -19,10 +19,10 @@ const stderr = console.error.bind(console);
let rollup: any;

const inject_styles = `
export default files => {
return Promise.all(files.map(file => new Promise((fulfil, reject) => {
const href = new URL(file, import.meta.url);
let link = document.querySelector('link[rel=stylesheet][href="' + href + '"]');
export default function(files) {
return Promise.all(files.map(function(file) { return new Promise(function(fulfil, reject) {
var href = new URL(file, import.meta.url);
var link = document.querySelector('link[rel=stylesheet][href="' + href + '"]');
if (!link) {
link = document.createElement('link');
link.rel = 'stylesheet';
Expand All @@ -32,10 +32,10 @@ export default files => {
if (link.sheet) {
fulfil();
} else {
link.onload = () => fulfil();
link.onload = function() { return fulfil() };
link.onerror = reject;
}
})));
})}));
};`.trim();

const get_entry_point_output_chunk = (bundle: OutputBundle, entry_point?: string) => {
Expand Down Expand Up @@ -130,7 +130,7 @@ export default class RollupCompiler {
if (targetModuleId) {
return {
left: 'Promise.all([import(',
right: `), ___SAPPER_CSS_INJECTION___${Buffer.from(targetModuleId).toString('hex')}___]).then(x => x[0])`
right: `), ___SAPPER_CSS_INJECTION___${Buffer.from(targetModuleId).toString('hex')}___]).then(function(x) { return x[0]; })`
};
} else {
return {
Expand Down

0 comments on commit 4449338

Please sign in to comment.