svelte-lighthouse-viewer
v0.1.246
Published
This component is a Svelte wrapper for the lighthouse-viewer. It depends on [lighthouse-viewer](../lighthouse-viewer), package that exports the original lighthouse-viewer from Google as an ES modules package.
Downloads
163
Maintainers
Readme
svelte-lighthouse-viewer
This component is a Svelte wrapper for the lighthouse-viewer. It depends on lighthouse-viewer, package that exports the original lighthouse-viewer from Google as an ES modules package.
Getting started
- Install using
npm install svelte-lighthouse-viewer
oryarn add svelte-lighthouse-viewer
- Import in your project:
import SvelteLighthouseViewer from 'svelte-lighthouse-viewer';
- Load the component in your code as follows:
const svelteAppElement = document.getElementById('svelte-app');
if (svelteAppElement) {
const app = new SvelteLighthouseViewer({
target: svelteAppElement,
props: {
json: reportJson,
},
});
}
- That's all!