forked from cybrespace/pinafore
add URLSearchParams polyfill
This commit is contained in:
parent
bd6e2827c9
commit
a249b2a608
|
@ -5011,6 +5011,11 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"url-search-params": {
|
||||||
|
"version": "0.10.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/url-search-params/-/url-search-params-0.10.0.tgz",
|
||||||
|
"integrity": "sha512-oFPzmbPAbdthStgffGq8alULe47skPDt1X3KW6NOQnKkcLHP4IS1NfdfHG/CBP5lGsr2gDzNp87pfWLx/eIxjw=="
|
||||||
|
},
|
||||||
"util": {
|
"util": {
|
||||||
"version": "0.10.3",
|
"version": "0.10.3",
|
||||||
"resolved": "https://registry.npmjs.org/util/-/util-0.10.3.tgz",
|
"resolved": "https://registry.npmjs.org/util/-/util-0.10.3.tgz",
|
||||||
|
|
|
@ -27,6 +27,7 @@
|
||||||
"svelte": "^1.50.0",
|
"svelte": "^1.50.0",
|
||||||
"svelte-loader": "^2.3.3",
|
"svelte-loader": "^2.3.3",
|
||||||
"uglifyjs-webpack-plugin": "^1.1.5",
|
"uglifyjs-webpack-plugin": "^1.1.5",
|
||||||
|
"url-search-params": "^0.10.0",
|
||||||
"webpack": "^3.10.0"
|
"webpack": "^3.10.0"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
|
|
|
@ -1,4 +1,17 @@
|
||||||
import { init } from 'sapper/runtime.js';
|
import { init } from 'sapper/runtime.js';
|
||||||
|
|
||||||
// `routes` is an array of route objects injected by Sapper
|
// polyfills
|
||||||
init(document.querySelector('#sapper'), __routes__);
|
Promise.all([
|
||||||
|
typeof URLSearchParams === 'undefined' && import('url-search-params').then(Params => {
|
||||||
|
window.URLSearchParams = Params
|
||||||
|
Object.defineProperty(window.URL.prototype, 'searchParams', {
|
||||||
|
get() {
|
||||||
|
return new Params(this.search)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
]).then(() => {
|
||||||
|
console.log('done')
|
||||||
|
// `routes` is an array of route objects injected by Sapper
|
||||||
|
init(document.querySelector('#sapper'), __routes__)
|
||||||
|
})
|
Loading…
Reference in New Issue