src/browser.ts

This is the entry point for the main.js javascript bundle which is added to the window.

You can use this file to enable the following two Layer0 features. By default both are placed in the file for your convenience.

  • Enable Layer0 Prefetcher on client side. This can be done as following:
browser.ts
import install from '@layer0/prefetch/window/install'

document.addEventListener('DOMContentLoaded', function () {
  // @ts-ignore
  install()
})
  • Enable Layer0 Devtools on client side.
browser.ts
import installDevtools from '@layer0/devtools/install'

document.addEventListener('DOMContentLoaded', function () {
  // @ts-ignore
  installDevtools()
})
Edit this page on GitHub Updated at Tue, Jun 21, 2022