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

mvc-works/pages-rev

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Pages-Rev

Simple web resources revision tool.

Usage

npm i --save-dev pages-rev
rev = require 'pages-rev'

rev.run
  base: "#{__dirname}/example/"
  dest: "#{__dirname}/dist/"
  ignoreDirs: ['node_modules']
  entries: ['index.html', 'ejs/index/ejs']
  prefix: '/' # or cdn url

Options

  • base(required)

Base path, usually where index.html is, or the directory corresponds the domain. Uses absolute path.

  • dest(required)

The directory to write revisioned files. Uses absolute path.

  • ignoreDirs

Folders not needed to scan. Without /s.

  • entries(required)

Files to start. Usually index.html or templates that can be viewed with URLs. Only files with extnames as .html, .css and the extnames of entries are scanned.

  • prefix(required)

URL prefix to the domain. May be /, /x/y or CDN urls. Ends with '/'.

Assumptions

This plugin has these assumptions:

  • Resources are wrapped inside: "", '', or ()
  • Resource names do not contains \
  • Path base corresponds to the domain(or directory of index.html)
  • Files with same extname as files in entries are not renamed

License

MIT