모던 웹 컴포넌트 개발을 위한 TypeScript, Vite, Lit 템플릿입니다.
Use this template 버튼을 클릭하여 이 템플릿을 기반으로 새 리포지토리를 생성하세요.
- ⚡️ Vite - 빠른 개발 서버와 빌드
- 🔷 TypeScript - 타입 안정성
- 🎨 Lit - 웹 컴포넌트 프레임워크
- 🎯 예제 컴포넌트 포함:
- Counter 컴포넌트
- Todo List 컴포넌트
npm install
npm run dev
브라우저에서 http://localhost:3000 으로 접속
npm run build
npm run preview
npm run typecheck
typescript-vite-lit-template/
├── public/
│ └── vite.svg
├── src/
│ ├── components/
│ │ ├── my-element.ts # Counter 예제 컴포넌트
│ │ └── todo-list.ts # Todo List 예제 컴포넌트
│ ├── index.ts # 컴포넌트 export
│ ├── main.ts # 앱 엔트리 포인트
│ └── style.css # 글로벌 스타일
├── index.html
├── package.json
├── tsconfig.json
└── vite.config.ts
<my-element name="World"></my-element>
<todo-list></todo-list>
import { LitElement, html, css } from 'lit';
import { customElement, property } from 'lit/decorators.js';
@customElement('new-component')
export class NewComponent extends LitElement {
static styles = css`
:host {
display: block;
}
`;
@property({ type: String })
message = 'Hello';
render() {
return html`
<div>${this.message}</div>
`;
}
}
MIT