web-component-starter
v1.0.2
Published
Starter web component project
Downloads
7
Maintainers
Readme
Web Component Starter
Boilerplate project for building a web component that is fully equipped with TypeScript and is ready to be published to NPM.
This is a framework agnostic component, however when using it in React - we recommended that you wrap it using a dedicated library to overcome some web component incompatibilities (read docs and tests). See example.
:rocket: Setup commands
npm install
Installs node dependencies.
npm run build
Builds the component.
npm run build:watch
Used to automatically rebuild the component as soon as any changes are made to the code.
npm run serve
Serves the component locally (from index.html).
:construction_worker: Other commands
npm run build:bundle
Bundles the component into a single file (to dist/web-component-starter-fast.bundle.js). This is great for serving the component via a CDN, such as UPKG (example).
npm run analyze
Builds a custom elements manifest (custom-elements.json) which can be used by assistive tools to benefit the custom element development experience.
:books: More information
You can find out more information on how to build vanilla web components in Mozilla docs and web dev. Additionally, a great list of vanilla examples can be found here.
:yellow_heart: Contributions
Open source is built by the community for the community. All contributions to this project are welcome! Additionally, if you have any suggestions for enhancements, ideas on how to take the project further or have discovered a bug, do not hesitate to create a new issue ticket and we will look into it as soon as possible!