Skip to content
This repository has been archived by the owner on Nov 28, 2018. It is now read-only.

Static builder without gulp or webpack for projects requiring the complexity of a wooden stick.

Notifications You must be signed in to change notification settings

szkrd/static-build-seed-wooden-stick

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Static build seed wooden stick

Build static resources without gulp or webpack for projects as complex as a wooden stick.

  • Requires node v9+
  • The build tool has no watcher use nodemon, chokidar or whatever you want for watching
  • It uses mtimes for change detection
  • Supports ejs and less out of the box
  • Source folder is src, target folder is dist (hardcoded)
  • Hooks:
    • ignore filename: recursive-readdir's ignore function
    • inject template data (ejs): getTemplateData(source, target)
    • postprocess content (html, css, less): processContent(source, target, content)
    • process file naming: processFileName(source, target, context)
  • Build strategies:
    • lazy: build changed files (not exactly useful with template includes of course), this is the default
    • force: ignore mtimes for editable content (so images won't be copied needlessly for example)
    • build: bust cache, destroy dist, rebuild everything
  • See index.js for examples

Tips and tricks

  • npm run serve to serve the dist folder (or just use WebStorm's builtin seerver)
  • Use script links and style links
  • Use <%= version %> for a build timestamp
  • To use a vendor.js: create a vendor.ejs, include whatever you need and then hook into the file renamer (or just use an external CDN)
  • No minification, no js transpilation, no polyfills, no postcss

About

Static builder without gulp or webpack for projects requiring the complexity of a wooden stick.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published