pinafore/templates/main.js

16 lines
512 B
JavaScript
Raw Normal View History

2018-01-06 23:51:25 +00:00
import { init } from 'sapper/runtime.js';
2018-01-08 07:00:15 +00:00
// polyfills
Promise.all([
2018-01-08 07:02:25 +00:00
typeof URLSearchParams === 'undefined' && import(/* webpackChunkName: 'url-search-params' */ 'url-search-params').then(Params => {
2018-01-08 07:00:15 +00:00
window.URLSearchParams = Params
Object.defineProperty(window.URL.prototype, 'searchParams', {
get() {
return new Params(this.search)
}
})
})
]).then(() => {
// `routes` is an array of route objects injected by Sapper
init(document.querySelector('#sapper'), __routes__)
})