$ npm install -g preact-cli
$ preact create widget my-widget
$ cd my-widget
$ npm install
$ npm run dev
dev: Starts a dev server with hotreload and widget placeholder.
build: Builds a documentation web app in build
folder and a production ready UMD bundle ready to be embedded in any non-preact page.
dist: Builds npm ready bundles in dist
folder to be consumed by other preact
web apps.
start: Either starts a production ready dev server demo-ing your widget or local env based on your environment variable.
test: Runs your awesome UI tests with Jest.
serve: Builds and serves your widget.