Lit playground downloaded code don't run locally. #3113
-
I downloaded my-timer files from Lit playground (https://lit.dev/playground/#sample=docs/what-is-lit)
download package.json contains below dependencies:
I removed the above package.json and added another package.json file suggested by (https://codelabs.developers.google.com/codelabs/the-lit-path#1) VS Code setup section. here is my new package.json file (https://gist.github.com/e111077/c9d4512dcc35f483abbebf95da24609b) also added tsconfig.json file as I am getting errors for typescript. also added web-dev-server as suggested my latest code is here (https://github.com/abhijeet-shelhalkar/my-timer-lit). |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
This is something we do want to make more seamless down the line. lit/lit.dev#690 You've got most of the needed pieces there but I don't see npm i -D typescript You'd then want to run Your tsconfig file should also include |
Beta Was this translation helpful? Give feedback.
This is something we do want to make more seamless down the line. lit/lit.dev#690
You've got most of the needed pieces there but I don't see
typescript
as a dev dependency in your package.json. You could have it installed globally but I'd recommend installing it for the project.You'd then want to run
npx tsc
to compile the .ts files to .js so the browser can pick it up. You can also donpx tsc --watch
to keep it running in watch mode so any changes you make to the .ts files will automatically be compiled.Your tsconfig file should also include
"useDefineForClassFields": false
for the@property
decorator to work. https://lit.dev/docs/components/decorators/#decorators-t…