You're viewing docs for an older version of Lit. Click here for the latest version.
Publish a component
This page describes how to publish a LitElement component to npm.
We recommend publishing JavaScript modules in standard ES2017. If you're writing your element in standard ES2017, you don't need to transpile for publication. If you're using TypeScript, or ES2017+ features such as decorators or class fields, you will need to transpile your element for publication.
Your package.json configuration should have both the main and module fields:
package.json
{
"main": "my-element.js",
"module": "my-element.js"
}
You should also create a README describing how to consume your component. A basic guide to consuming LitElement components is documented at Use a component.