Sha256: b07379553eb8a8969dfca5c594c293ecddf1349764a336ca2119aa6828303953

Contents?: true

Size: 1.83 KB

Versions: 9

Compression:

Stored size: 1.83 KB

Contents

module.exports = function(grunt) {
  var allSassFiles = [];

  var path = require('path');

  grunt.file.recurse(
    "./stylesheets/",
    function(abspath, rootdir, subdir, filename) {
      if(typeof subdir !== 'undefined'){
        var relpath = subdir + '/' + filename;
      } else {
        var relpath = filename;
      }
      if (filename.match(/\.scss/)) {
        allSassFiles.push("@import '" + relpath + "';");
      }
    }
  );

  grunt.file.write(
    "./spec/stylesheets/test.scss",
    allSassFiles.join("\n")
  );

  grunt.initConfig({
    clean: {
      sass: ["spec/stylesheets/test*css"]
    },
    jasmine: {
      javascripts: {
        src: [
          'node_modules/jquery-browser/lib/jquery.js',
          'javascripts/govuk/analytics/google-analytics-classic-tracker.js',
          'javascripts/govuk/analytics/google-analytics-universal-tracker.js',
          'javascripts/govuk/analytics/tracker.js',
          'javascripts/**/*.js'
        ],
        options: {
          specs: 'spec/unit/**/*Spec.js',
          helpers: 'spec/unit/*Helper.js'
        }
      }
    },
    sass: {
      development: {
        files: {
          './spec/stylesheets/test-out.css': './spec/stylesheets/test.scss'
        },
        options: {
          loadPath: [
            './stylesheets'
          ],
          style: 'nested',
        }
      },
    },
    scsslint: {
      allFiles: [
        'stylesheets/*.scss',
        'stylesheets/**/*.scss'
      ],
      options: {
        bundleExec: true,
        config: '.scss-lint.yaml'
      }
    }
  });

  grunt.loadNpmTasks('grunt-contrib-clean');
  grunt.loadNpmTasks('grunt-contrib-jasmine');
  grunt.loadNpmTasks('grunt-contrib-sass');
  grunt.loadNpmTasks('grunt-scss-lint');

  grunt.registerTask('test', ['sass', 'clean', 'jasmine', 'scsslint']);
  grunt.registerTask('default', ['test']);
};

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
govuk_frontend_toolkit-3.5.1 app/assets/Gruntfile.js
govuk_frontend_toolkit-3.5.0 app/assets/Gruntfile.js
govuk_frontend_toolkit-3.4.2 app/assets/Gruntfile.js
govuk_frontend_toolkit-3.4.1 app/assets/Gruntfile.js
govuk_frontend_toolkit-3.4.0 app/assets/Gruntfile.js
govuk_frontend_toolkit-3.3.1 app/assets/Gruntfile.js
govuk_frontend_toolkit-3.3.0 app/assets/Gruntfile.js
govuk_frontend_toolkit-3.2.1 app/assets/Gruntfile.js
govuk_frontend_toolkit-3.2.0 app/assets/Gruntfile.js