Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
A Grunt plugin for wrapping project text files
JavaScript
branch: master
Failed to load latest commit information.
bin
tasks added empty string fix, restored jshint
test readme expanded, enchanced tests
.gitignore rewrite using grunt convention for files selector and options, added …
.npmignore Cleanup
Gruntfile.js
LICENSE-MIT initial commit
README.md
package.json bumped version to 0.3.0

README.md

grunt-wrap

Wraps text files

Getting Started

Install this grunt plugin next to your project's grunt.js gruntfile with: npm install grunt-wrap

Then add this line to your project's grunt.js gruntfile:

grunt.loadNpmTasks('grunt-wrap');

Documentation

Configure which files to be copied in your initConfig:

grunt.initConfig({

  // ... other configs

  // wrap my modules with define
  wrap: {
    basic: {
      src: ['assets/*.js'],
      dest: 'dist/',
      options: {
        wrapper: ['define(function (require, exports, module) {\n', '\n});']
      }
    },
    advanced: {
      cwd: 'files/',
      expand: true,
      src: ['**/*.js', '**/*.css'],
      dest: 'dist/',
      options: {
        seperator: '\n',
        indent: '\t',
        wrapper: function(filepath, options) {
          return ['// ' + filepath, ''];
        },
        rename: function(dest, src) {
           return path.join(dest, src.replace(/(\.[\w]+)$/g, '.tagged$1'));
        }
      }
    }
  },

  // ... other configs
});

Grunt 0.3.x support

v0.1.0 is the last version to support grunt 0.3.x. This version is frozen and available here

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 grunt.

Release History

  • 2013 Apr 30 - v0.3.0 - Rewrite with grunt file/option convention, unit test (Bartvds), grunt version to 0.4.1
  • 2013 Jan 31 - v0.2.0 - Implements grunt 0.4 compatibility measures, breaking support for grunt 0.3.x
  • 2012 Oct 4 - v0.1.0 - Initial release.

License

Copyright (c) 2013 Christopher Rogers Licensed under the MIT license.

Something went wrong with that request. Please try again.