web-component-boilerplate
Licensed under ISC License copyright (c) 2020 Dan McKeown.
Table Of Contents
features
This project provides the following features:
- Starter for new component-powered web projects powered by Preact and htm
- Bundles dependencies using Snowpack
- To deploy this site, upload the index.html and the static, src, and web_modules directories to your server and serve it as static html
quickstart
=== download and build
- git clone
git-url-here
cd web-component-boilerplate
npm install
npm run build
=== serve the site
npm run start
(defaults to using theserve
tool but you can serve the site with your preferred static site server)open [http://localhost:5000](http://localhost:5000)
(to visit the server)
requirements
- NodeJS
- NPM
installation
- Check NodeJS version:
node --version
- Check NPM version:
npm --version
- Clone the Git repo:
git clone <repo-url>
usage
- Use the code as a scaffold for creating a new site (for example edit app.js or create a new component to import into index.js)
- Make sure to upload the index.html, /src directory, /static directory, and the /web_modules directory to your live site when you deploy
- By convention, non-code assets like images can be stored in the /static directory and referenced directly
demo-app
- For now, the best live example (built with an early version of web-component-boilerplate) is the sf3am.com front page
- Learn more about the project in this screencast