Sha256: 2dbcf0f497875e71b8a452a23b4189cea620e99365708a081eb08be690161ed8

Contents?: true

Size: 781 Bytes

Versions: 21

Compression:

Stored size: 781 Bytes

Contents

'use strict';
var fs = require('fs');
var path = require('path');

var COMMONJS_BANNER = '// This file is autogenerated via the `commonjs` Grunt task. You can require() this file in a CommonJS environment.\n';

module.exports = function generateCommonJSModule(grunt, srcFiles, destFilepath) {
  var destDir = path.dirname(destFilepath);

  function srcPathToDestRequire(srcFilepath) {
    var requirePath = path.relative(destDir, srcFilepath).replace(/\\/g, '/');
    return 'require(\'' + requirePath + '\')';
  }

  var moduleOutputJs = COMMONJS_BANNER + srcFiles.map(srcPathToDestRequire).join('\n');
  try {
    fs.writeFileSync(destFilepath, moduleOutputJs);
  }
  catch (err) {
    grunt.fail.warn(err);
  }
  grunt.log.writeln('File ' + destFilepath.cyan + ' created.');
};

Version data entries

21 entries across 21 versions & 6 rubygems

Version Path
sedge_cms-0.0.1 vendor/assets/components/bootstrap/grunt/bs-commonjs-generator.js
date_picker-0.0.6 test/dummy/vendor/assets/components/bootstrap/grunt/bs-commonjs-generator.js
railsstrap-3.3.4 vendor/assets/bower_components/bootstrap/grunt/bs-commonjs-generator.js
date_picker-0.0.5 test/dummy/vendor/assets/components/bootstrap/grunt/bs-commonjs-generator.js
date_picker-0.0.4 test/dummy/vendor/assets/components/bootstrap/grunt/bs-commonjs-generator.js
date_picker-0.0.3 test/dummy/vendor/assets/components/bootstrap/grunt/bs-commonjs-generator.js
date_picker-0.0.2 test/dummy/vendor/assets/components/bootstrap/grunt/bs-commonjs-generator.js
date_picker-0.0.1 test/dummy/vendor/assets/components/bootstrap/grunt/bs-commonjs-generator.js
puppet-herald-0.8.1 lib/puppet-herald/public/bower_components/bootstrap/grunt/bs-commonjs-generator.js
puppet-herald-0.8.0 lib/puppet-herald/public/bower_components/bootstrap/grunt/bs-commonjs-generator.js
easy_html_creator-1.2.0 dev_root/demo-website-offline/public/bower_components/bootstrap/grunt/bs-commonjs-generator.js
railsstrap-3.3.2 vendor/assets/bower_components/bootstrap/grunt/bs-commonjs-generator.js
hyhyhy-1.0.0 lib/hyhyhy/structure/_includes/bootstrap/grunt/bs-commonjs-generator.js
hyhyhy-0.0.9 lib/hyhyhy/structure/_includes/bootstrap/grunt/bs-commonjs-generator.js
hyhyhy-0.0.8 lib/hyhyhy/structure/_includes/bootstrap/grunt/bs-commonjs-generator.js
hyhyhy-0.0.7 lib/hyhyhy/structure/_includes/bootstrap/grunt/bs-commonjs-generator.js
hyhyhy-0.0.6 lib/hyhyhy/structure/_includes/bootstrap/grunt/bs-commonjs-generator.js
hyhyhy-0.0.5 lib/hyhyhy/structure/_includes/bootstrap/grunt/bs-commonjs-generator.js
hyhyhy-0.0.4 lib/hyhyhy/structure/_includes/bootstrap/grunt/bs-commonjs-generator.js
railsstrap-3.3.1 vendor/assets/bower_components/bootstrap/grunt/bs-commonjs-generator.js