lit / lit/lit.dev

How to import customElement, property from bundle

Open
#1,342 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
142
Forks
230
PR merge metrics
No merged PRs in 30d

Description

In the docs i'm told to use:

import {LitElement, html} from 'lit';
import {customElement, property} from 'lit/decorators.js';

but if i'm using bundle, only

import {LitElement, html} from 'https://cdn.jsdelivr.net/gh/lit/dist@3/core/lit-core.min.js';

is given.

how do i import customElement and property from jsdelivr.

I can see there is a file "lit-all" at https://cdn.jsdelivr.net/gh/lit/dist@3.1.4/all/ but it doesn't seem to export customElement or property, and neither does lit-core, i get the error

Module '"https://cdn.jsdelivr.net/gh/lit/dist@3.1.4/all/lit-all.min.js"' has no exported member 'property'

Is the decorator module hosted elsewhere?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Compare the documented imports with the lit-core.min.js and lit-all.min.js URLs mentioned in the issue, focusing on whether either bundle exports customElement and property. The documentation is done when it gives a verified jsDelivr import or clearly explains where the decorator module is hosted.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
documentation, web-dev
Issue type
Documentation
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.