runem / lit-analyzer

Monorepository for tools that analyze lit-html templates
MIT License
319 stars 38 forks source link

Automatically load custom-element.json #148

Closed mantou132 closed 3 years ago

mantou132 commented 3 years ago

When using third-party custom elements, if custom-element.json exists, it will be loaded as HTML customData.

e.g:

import * as Gem from '@mantou/gem'
// try load  `node_modules/@mantou/gem/custom-element.json`
import '@mantou/gem/elements/link'
// try load `node_modules/@mantou/gem/elements/link/custom-element.json`
// and `node_modules/@mantou/gem/elements/link-custom-element.json`

This is convenient for us to write custom element libraries in any form, because in the end we only need custom-element.json