0

I just recently downloaded grunt with 2 packages on my linux machine.

  1. Grunt-contrib-jasmine for command line jasmine unit testing.

Guide I followed: https://github.com/gruntjs/grunt-contrib-jasmine

  1. Grunt-template-jasmine-Istanbul for code coverage.

Guide I followed: https://github.com/maenu/grunt-template-jasmine-istanbul

I found my whole grunt folder to be quite massive and I was wondering if there was any way to slim it down. I have in my top level node_modules folder the packages: grunt, grunt-contrib-jasmine and grunt-template-jasmine-Istanbul. I've tried deleting files I thought were redundant but it seems that most libraries are needed even if repeated.

I'll post my GruntFile encase it will be of any help:

module.exports = function(grunt) {
  grunt.initConfig({
      jasmine: {
      coverage: {
          src: 'src/*.js',
          options: {
          specs: 'spec/*Spec.js',
          helpers: 'spec/*Helper.js',
          vendor: ['lib/jquery.js', 'lib/angular.js', 'lib/angular-touch.js', 'lib/angular-route.js', 'lib/angular-cookies.js', 
               'lib/ui-bootstrap.js', 'lib/jasmine-jquery.js', 'lib/angular-mocks.js'],

          template: require('grunt-template-jasmine-istanbul'),
          templateOptions: {
              coverage: 'coverage/coverage.json',
              report: {
              type: 'cobertura',
              options: {
                  dir: 'coverage/cobertura'
              }
              },
              thresholds: {
              lines: 50,
              statements: 50,
              branches: 50,
              functions: 50
              }
          }
          }
      }
      }
  });

  // Register tasks.
  grunt.loadNpmTasks('grunt-contrib-jasmine');

  // Default task.
  grunt.registerTask('default', 'jasmine');
};

Any help is appreciated.

EDIT: File path too long because of recurring node_modules doesn't allow jenkins to build.

Aliminator
  • 99
  • 6
  • What is the rationale behind this question? You want to save 10Mb of space? /me went to check the year on the calendar and price of the Gb for the consumer-level drives. – zerkms Mar 24 '15 at 20:51
  • Why not reduce the size if I can? I just see the same node_modules being used so figured there was redundancy. I'll agree with you though and not stress such a small amount of space. – Aliminator Mar 25 '15 at 13:38
  • I undeleted the post now because I just ran into a problem. The filepath size is too big to build in jenkins (around the 255 windows character limit). – Aliminator Mar 30 '15 at 20:00
  • So edit the whole question correspondingly so that it was not about size. – zerkms Mar 30 '15 at 20:07

1 Answers1

0

The way that I solved this is by using npmd's --greedy flag instead of npm when installing packages.

Npmd: https://github.com/dominictarr/npmd

Aliminator
  • 99
  • 6