create-wc extends @open-wc/create and scaffolds Lit web components with a batteries-included setup for linting, formatting, testing, Sass, Vite, and Custom Elements Manifest generation.
Example output:
Use this section if you want the shortest path from zero to a working component.
npm init @blockquote/wcThe generator will ask for:
- The custom element tag name
- An optional namespace
- Whether the project should use TypeScript
After the project is generated:
cd your-project-name
npm install
npm startnpm start runs the Vite workflow together with the Sass watcher.
Use these commands once you already have a generated project.
npm run formatThis runs ESLint, Prettier, and Stylelint fixes.
npm run testFor interactive browser testing:
npm run test:watchBuild the demo assets:
npm run dev:vitePreview the built output:
npm run preview:viteIn TypeScript projects:
npm run buildThis runs Vite for bundling and tsc for declarations.
npm run analyzeAfter git init, run:
npm run prepare- Lit for component authoring
- Vite for local development and preview builds
- Vitest in browser mode plus
chai-a11y-axefor testing - ESLint, Prettier, and Stylelint for code quality
- Sass via sass-style-template
- Custom Elements Manifest generation and README tooling
These scripts are available in generated projects.
| Script | Purpose |
|---|---|
npm start |
Run Vite and the Sass watcher together |
npm run vite |
Start the Vite dev server |
npm run dev:vite |
Build the demo assets |
npm run preview:vite |
Preview the built demo |
npm run test |
Run Vitest |
npm run test:watch |
Run Vitest in browser mode without headless mode |
npm run analyze |
Generate the Custom Elements Manifest |
npm run prepare |
Install Husky hooks |
npm run format |
Run ESLint, Prettier, and Stylelint fixes |
npm run sass:watch |
Run the Sass watcher |
JavaScript projects:
npm run buildprints a message because there is no TypeScript build step.
TypeScript projects:
npm run buildruns the library build and TypeScript declaration output.
These scripts belong to this generator repository itself, not to generated projects.
| Script | Purpose |
|---|---|
npm start |
Run the generator locally |
npm run format |
Format this repository |
This project exists to provide a more opinionated starting point than raw @open-wc/create, while still building on its generator model instead of replacing it.
The generated scaffold is aimed at teams building Lit-based web components that want:
- A ready-to-run development setup
- Sass support out of the box
- Test tooling for browser-oriented component work
- Linting and formatting defaults across JavaScript, TypeScript, HTML, and styles
- Custom Elements Manifest generation as part of the workflow
The repository itself is intentionally small: it assembles mixins and templates that define the generated project structure and scripts.