JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 53498
  • Score
    100M100P100Q149621F
  • License MIT

Helper for svelte components to ease development

Package Exports

  • svelte-dev-helper

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (svelte-dev-helper) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

svelte-dev-helper

Helper for svelte components to ease development

##Usage

This is meant to be used under the hood for creating a build toolchain, or a dev helper based on Svelte components;

import {Registry, configure, createProxy} from 'svelte-dev-helper';
import Component from './Component.html'; //some svelte component

configure(configOptions);

const id = someUniqueID();

Registry.set(id, {
  component: Component,
  instances:[]
});

export createProxy(id);

The component returned by createProxy now does the following

  1. Add a <!--<Component>--> comment marker in the DOM just above where the component's DOM starts
  2. You can access the component instance using $0.__component__ in devtools after higlighting the comment marker from above.