Skip to content
/ spa Public template

📐 Single Page Application template

Notifications You must be signed in to change notification settings

zbo14/spa

Repository files navigation

spa

Frameworkless Single-Page Application (SPA) template.

Features

Project structure

TODO

Install

Use this template, 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.