1 KiB
1 KiB
wcb-button
A publishable custom element built on
web-component-base, scaffolded with
npm create wcb@latest.
Commands
npm run dev— start the Vite dev server on theindex.htmldemo pagenpm run build— build the demo pagenpm run build:lib— build the library: ESM + UMD bundles and.d.tstypes indist/, withweb-component-baseleft external (it is a peerDependency)npm run analyze— generatecustom-elements.jsonfrom the component'sstatic props
Publishing
npm publish (or npm pack) runs the prepack script, which rebuilds the
library and regenerates custom-elements.json — both ship inside the
package, and the customElements field in package.json is how Storybook,
editors, and other tooling discover the manifest. In the repo itself the
manifest stays gitignored; it is a build artifact.
See the CEM plugin guide for setting it up with Storybook and code editors.
Just keep building.