-
Notifications
You must be signed in to change notification settings - Fork 4
/
index.js
24 lines (20 loc) · 912 Bytes
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import Raven from 'raven-js'
import IntlMessageFormat from 'intl-messageformat'
import { config } from './src/engine'
document.addEventListener('WebComponentsReady', function webcomponentsready () {
import(/* webpackChunkName: "polymer" */ './bower_components/polymer/polymer.html').then(() => {
import(/* webpackChunkName: "vientos-shell" */ './app/vientos-shell/vientos-shell.html')
})
})
// required by app-localize-behavior
window.IntlMessageFormat = IntlMessageFormat
// report errors to sentry.io
if (config.sentry) Raven.config(config.sentry).install()
// Load and register Service Worker
if (process.env.NODE_ENV === 'production' || process.env.NODE_ENV === 'staging') {
if ('serviceWorker' in navigator) {
window.addEventListener('load', function registerServiceWorker () {
navigator.serviceWorker.register(document.querySelector('base').href + 'service-worker.js')
})
}
}