0.7.2 • Published 10 years ago

rjs-build-hasher v0.7.2

Weekly downloads
2
License
-
Repository
github
Last release
10 years ago

rjs-build-hasher Build Status

Calculates hashes of bundles generated by require.js. Supports renaming bundle files by given format, plus a few other options. Uses the peg parser used in rjs-build-analysis by Merrick Christensen.

Installation

npm install --save-dev rjs-build-hasher

Documentation

Default options

  • buildPath: js/build
  • format: {base}.{hash}{ext} - Format used for new name when renaming (or copying) built files.
  • rename: true
  • copy: false (overrides rename if true)
  • removeOld: true
  • hashSize: 8

Usage

Example: used with grunt-contrib-requirejs

grunt.initConfig({
	requirejs: {
		compile: {
			options: {		
				done: function (done, output) {
				
					var bundles = require('rjs-build-hasher')(output, {
						buildPath: 'public/js'
					});
					
					// save info about built files to configuration
					grunt.file.write('config/built-modules.json', JSON.stringify(bundles, null, 2));
					
					done();

Contributing

Accepting pull requests. Will appreciate it if you add unit tests for any new or changed functionality. Lint and test your code using Grunt.

Release History

See commit history.

License

Copyright (c) 2015. Licensed under the MIT license.

0.7.2

10 years ago

0.7.1

10 years ago

0.7.0

12 years ago

0.6.4

12 years ago

0.6.3

12 years ago

0.6.2

12 years ago

0.6.1

12 years ago

0.6.0

12 years ago

0.5.0

12 years ago

0.4.0

12 years ago

0.3.1

12 years ago

0.3.0

12 years ago

0.2.0

12 years ago

0.1.0

12 years ago

0.0.1

12 years ago