How to deploy / bundle a Lit component?

I am interested in Lit for which I’ve glanced through this official tutorial but I don’t see any teaching on how to build or bundle this, considering that it’s in TypeScript.

Hi @anjanesh1

Lit is new to me, but a scan through the docs there is a Tools and Workflows section, which might be worth a read.

https://lit.dev/docs/tools/requirements/
https://lit.dev/docs/tools/development/

HTH

Thanks rpg. My main concern is using TypeScript which needs to compile the .ts files to .js and I can’t seem to find the required lines to do so.

Unfortunately I don’t have experience with typescript, albeit it is something that is becoming more appealing to me.

Lit appears to have some established organisations using it, so you would assume this is all doable.

Have you tried creating a very simple ‘Hello world’ example to see if you can get something working?

There is a community section, so maybe you could find out more info there?

Would be interesting to see what you find out :slight_smile:

I finally got it working - there were a lot of inconsistencies in the documentation - lie for example - using import html from '@web/rollup-plugin-html';
which should be - import { rollupPluginHTML as html } from "@web/rollup-plugin-html"; - https://anjane.sh/getting-started-with-lit

2 Likes

Thank you for sharing that @anjanesh1,

I have only had chance to read through the first few paragraphs, but that is going to be an interesting read :slight_smile:

1 Like