grunt-dep-concat

Concatenate files in order based on dependencies.

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
grunt-dep-concat
720.1.210 years ago11 years agoMinified + gzip package size for grunt-dep-concat in KB

Readme

grunt-dep-concat
Concatenate files in order based on dependencies.

Getting Started

Install this grunt plugin next to your project's grunt.js gruntfilegettingstarted with: npm install grunt-dep-concat
Then add this line to your project's grunt.js gruntfile:
grunt.loadNpmTasks('grunt-dep-concat');

Documentation

This plugin requires tsort.
So you have a large number of files with implicit dependencies based on the order in which you list them in your gruntfile, and which must be manually maintained. Don't we have new-fangled computer things to sort this out for us? Add this to your source files:
// load: some_loadtime_dependency.js

// run: a_runtime_dependency.js
/* run: another_runtime_dependency.js */
// run: a.js, long/list.js, of/runtime/dependencies.js

(function() {
  // …
}( SomeLoadtimeDependency ));

Then, instead of using the concat task, use the depconcat.
grunt.initConfig({
  depconcat: {
    dist: {
      src: ['src/**/*.js'],
      dest: 'dist/foo.js'
    }
  }
});

Contributing

In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using gruntgrunt.

Release History

  • 2012/06/12 - v0.1.1 - Initial release.

License

Copyright (c) 2012 Eric Li Licensed under the MIT license.