https://github.com/zbo14/spa
📐 Single Page Application template
https://github.com/zbo14/spa
bash esbuild eslint html husky javascript less spa stylelint
Last synced: 3 months ago
JSON representation
📐 Single Page Application template
- Host: GitHub
- URL: https://github.com/zbo14/spa
- Owner: zbo14
- Created: 2022-03-11T19:54:06.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2022-04-10T18:52:36.000Z (about 4 years ago)
- Last Synced: 2025-10-11T02:16:51.606Z (9 months ago)
- Topics: bash, esbuild, eslint, html, husky, javascript, less, spa, stylelint
- Language: Shell
- Homepage:
- Size: 75.2 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# spa
Frameworkless Single-Page Application (SPA) template.
## Features
* Supports [Less CSS](https://lesscss.org/) styles
* Bundling via [esbuild](https://esbuild.github.io/)
* Linting via [`standard`](https://www.npmjs.com/package/standard) (JS) and [`stylelint`](https://www.npmjs.com/package/stylelint)+[`postcss-less`](https://www.npmjs.com/package/postcss-less) (Less)
* Git hooks via [`husky`](https://typicode.github.io/husky/#/)
* Some helpful bash scripts
## Project structure
TODO
## Install
[Use this template](https://github.com/zbo14/spa/generate), clone your repo, and `npm i`.
## Usage
### Bundle
`npm run bundle`
This bundles all the JavaScript in `src/` and writes to `public/bundle.js`.
### Compile CSS
`npm run compile-css`
This generates CSS stylesheets in `public/` from the Less files in `src/`
### Build
`npm run build`
This compiles the CSS and then bundles the JavaScript.
### Run development server
`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.
### Lint
`npm run lint`
This lints the JavaScript and Less files in `src/`.
**Note:** this script is run on the `pre-commit` Git hook.