fingerprint - How to rename the final generated file in a Brunch plugin? -


i'm developing plugin brunchjs , don't understand everything.

https://github.com/dlepaux/fingerprint-brunch inspirated github.com/mutewinter/digest-brunch , github.com/jgallen23/grunt-hash

concept : rename output filename , write manifest key (to real filename).

exemple : in config file want make /js/master.js file.

the goal of plugin rename filename : master.[hash].js

next write in manifest : {'/js/master.js' : '/js/master.[hash].js'}

i hope me understand how what do.

exports.config =   paths:     public: './../public'     compass: './config.rb'     watched: ['app']    files:     javascripts:       jointo:          '/js/master.js': /^(bower_components[\/\\]bootstrap-sass-twbs|bower_components[\/\\]bootstrap-datepicker|app)/          #'/js/vendor/response.js': /^(bower_components[\/\\]responsejs)/         #'/js/vendor/head.min.js': /^(bower_components[\/\\]headjs)/         #'/js/vendor/jquery.min.js': /^(bower_components[\/\\]jquery)/         #'/js/vendor/media.match.min.js': /^(bower_components[\/\\]media-match)/    modules:     wrapper: false     definition: false    conventions:     # don't want javascripts in asset folders copied 1 in      # bootstrap assets folder     assets: /assets[\\/](?!javascripts)/    plugins:     cleancss:       keepspecialcomments: 0       removeempty: true     sass:       debug: 'comments' # or set 'debug' firesass-style output     fingerprint:       manifest: '../../assssssets.json'       targets: ['/js/master.js'] 

in configuration file, @ bottom, see fingerprint, here set file in config.files want hash, because imagine don't put hash everywhere !

my problem is, don't know how rename final file... how can ? - renaming final file ? - duplicating master.js (generated) , rename ?

i must in oncompile function? or teardown (at end) ?

i have doc : github.com/brunch/brunch/blob/stable/docs/plugins.md

i'm confused..

thank you

take @ approach of plugin digest-brunch: https://github.com/mutewinter/digest-brunch

it uses oncompile , lots of code cover edge cases.

that should trick.


Comments

Popular posts from this blog

Fail to load namespace Spring Security http://www.springframework.org/security/tags -

sql - MySQL query optimization using coalesce -

unity3d - Unity local avoidance in user created world -