
Security News
Browserslist-rs Gets Major Refactor, Cutting Binary Size by Over 1MB
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.
generator-web-component
Advanced tools
Quickly scaffold lightweight web components with Yeoman, with just what's needed and none of the cruft. Built against the v1 Web Components spec.
Check out the files in app/templates
in this repo for a better idea of what you'll get.
Install Yeoman and the component generator with NPM or Yarn
$ npm i -g yo generator-web-component
Then run it
$ yo web-component
To create a new web component for use inside an existing project, select 'Part of an app'
when prompted. This will generate a single HTML file under the name of your element with the bare minimum of boilerplate.
To create a standalone element project in its own repo, select 'Standalone'
when prompted. This will scaffold out a modern Web Component project, including a lightweight testing setup, a beautiful demo page, and standard config files.
It's recommended to build your element as an ES6 class directly in the [element-name].html
file provided (or change it to a JavaScript file if you like), and allow the consumers of your element to do their own transpilation to ES5 if they want to support legacy browsers.
The following NPM scripts will be configured for you:
Script | Description |
---|---|
test | Runs your WCT test suite in local browsers |
posttest | Runs Eslint after tests (eg: for Travis) |
demo | Runs a demo server (with Browsersync) which reloads whenever you make changes in your component |
Run the scripts with NPM
$ npm run demo
The demo server is available on
localhost:3000
There are a few more options that should be added to this generator, if you'd like to contribute a PR adding any of these features I'll gladly merge it!
web-component-cli
? In similar vein to polymer-cli
but not tied to a frameworkMIT © Sean King
v2.1.0 (2018-02-26)
FAQs
Quickly scaffold web components with Yeoman
The npm package generator-web-component receives a total of 5 weekly downloads. As such, generator-web-component popularity was classified as not popular.
We found that generator-web-component demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.
Research
Security News
Eight new malicious Firefox extensions impersonate games, steal OAuth tokens, hijack sessions, and exploit browser permissions to spy on users.
Security News
The official Go SDK for the Model Context Protocol is in development, with a stable, production-ready release expected by August 2025.