Skip to content

Latest commit

 

History

History
39 lines (30 loc) · 952 Bytes

README.md

File metadata and controls

39 lines (30 loc) · 952 Bytes

keyword-brunch

make brunch replace keywords of public files after every time complied

Usage

Add `"keyword-brunch": "x.y.z"` to `package.json` of your brunch app.

Pick a plugin version that corresponds to your minor (y) brunch version.

If you want to use git version of plugin, add "keyword-brunch": "git+ssh://[email protected]:bolasblack/keyword-brunch.git".

Usage:

module.exports = 
  keyword:
    # file filter
    filePattern: /\.(js|css|html)$/

    # Extra files, add brunch didn't process file here,
    # will not filter by `filePattern`
    extraFiles: [
      "public/humans.txt"
    ]

    # Now keyword-brunch has these keyword:
    #     {!version!}, {!name!}, {!date!}, {!timestamp!}
    # read information from package.json
    map:
      "{!version!}": processer

plugin will do:

fileContent = fileContent.replace RegExp("{!version!}", "g"), processer