Skip to content

A plugin to run a function before every Brunch compile

License

Notifications You must be signed in to change notification settings

nerevu/before-brunch-func

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

before-brunch-func

Want to run a javascript function every time brunch compiles? Easy.

Usage

Add "before-brunch-func": "x.y.z" to package.json of your brunch app. Or npm install before-brunch-func --save.

Then in your config.coffee just add to the func parameter, a function that accepts an errback as its only argument . E.g.

beforeFunc = (errback) ->
  console.log 'hello world'
  errback false

For example, you might want to build metalsmith before each compile.

metalsmith = require './metalsmith'

exports.config =plugins:
    before:
      func: metalsmith.build.bind(metalsmith)
      pattern: /^src/  # default
      warnOnly: false  # default
      firstCompileOnly: false  # default

About

A plugin to run a function before every Brunch compile

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published