Frameworkless Single-Page Application (SPA) template.
- Supports Less CSS styles
- Bundling via esbuild
- Linting via
standard
(JS) andstylelint
+postcss-less
(Less) - Git hooks via
husky
- Some helpful bash scripts
TODO
Use this template, clone your repo, and npm i
.
npm run bundle
This bundles all the JavaScript in src/
and writes to public/bundle.js
.
npm run compile-css
This generates CSS stylesheets in public/
from the Less files in src/
npm run build
This compiles the CSS and then bundles the JavaScript.
npm run dev [port] [addr]
This runs an HTTP server that serves the content in public/
. When any JavaScript in src/
changes, the bundle is regenerated. When styles are changed, the CSS is recompiled.
The server listens on address 127.0.0.1 (loopback interface), port 8000 by default. You may specify your own address/port.
npm run lint
This lints the JavaScript and Less files in src/
.
Note: this script is run on the pre-commit
Git hook.