keyword-brunch
Adds keyword processing support to brunch.io application packager.
Last updated 3 years ago by huafu .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install keyword-brunch 
SYNC missed versions from official npm registry.

keyword-brunch

A brunch plugin to replace predefined keywords of public files after every compilation.

Usage

Install

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 the latest repository version, install the plugin by running the following command:

npm install --save "git+ssh://git@github.com:huafu/keyword-brunch.git"

Usage in your application

Usage:

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

    # Extra files to process which `filePattern` wouldn't match
    extraFiles: [
      "public/humans.txt"
    ]

    # By default keyword-brunch has these keywords:
    #     {!version!}, {!name!}, {!date!}, {!timestamp!}
    # using information from package.json
    map:
      myDate: -> (new Date).toISOString()
      someString: "hello"

The plugin will replace any keyword in map surrounded with '{!' and '!}' by the result of the given associated function or with the given associated string. The functions are re-calculated on every build, but only once per build, not at every file. So you can make some keywords for the current git repository branch, commit hash, ...

Current Tags

  • 2.0.0                                ...           latest (3 years ago)

10 Versions

  • 2.0.0                                ...           3 years ago
  • 1.7.8                                ...           6 years ago
  • 1.7.7                                ...           6 years ago
  • 1.7.6                                ...           6 years ago
  • 1.7.5                                ...           6 years ago
  • 1.7.4                                ...           6 years ago
  • 1.7.3                                ...           6 years ago
  • 1.7.2                                ...           7 years ago
  • 1.7.1                                ...           7 years ago
  • 1.7.0                                ...           7 years ago
Maintainers (1)
Downloads
Today 0
This Week 1
This Month 1
Last Day 1
Last Week 0
Last Month 0
Dependencies (2)
Dev Dependencies (7)

Copyright 2014 - 2016 © taobao.org |