/app-builder-boilerplate

App builder boilerplate

Primary LanguageShellMIT LicenseMIT

App builder boilerplate

After rewriting this boilerplate build and watch scripts over and over again, I've finally compiled it into a cloneable repo.

Original inspiration from Task Automation with Npm Run. Lots of improvements and further inspiration from How to Use npm as a Build Tool.

Getting started

Run npm install to fetch dependencies and to install git hooks. Git hooks are used for linting and running tests before pushing and merging.

Developing and Building

  • npm run watch builds with NODE_ENV=dev. Watches files in /src. Rebuilds on every change.
  • npm run build makes a build with NODE_ENV=production.
  • npm run test runs all in /src which matches *.spec.js using tape.

Files are built with a version suffix into /pub/, e.g. pub/bundle-1.0.0.js.

An AppCache Manifest file is also built. All files in /pub are included in the files list.

Bundled Dependencies

Tools Used in the Build, i.e. DevDependencies

All watch tasks make use of:

CSS

JavaScript

HTML and AppCache Manifest

For /src/**/*.html the strings __VERSION__ and __MANIFEST__ in the source are replaced with the version number and the manifest file name from package.json respectively.

To compile the HTML and AppCache manifest, find and sed are used.