A Grunt plugin for wrapping project text files
JavaScript
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
bin bin namechange Oct 4, 2012
tasks Updated with latest grunt-rename-wrap and added ability to escape cha… Oct 11, 2015
test
.gitignore
.npmignore Cleanup Feb 17, 2013
Gruntfile.js
LICENSE-MIT
README.md Update README.md Nov 26, 2013
package.json Tag version 1.3.1 Jun 12, 2017

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.