Sha256: 176b1848e80a7315b9ec1312a77bcbf94b3d01333a860e87eff56128443b0d6a

Contents?: true

Size: 1.71 KB

Versions: 15

Compression:

Stored size: 1.71 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/dist/jquery.js',
          'javascripts/govuk/analytics/google-analytics-universal-tracker.js',
          'javascripts/govuk/analytics/analytics.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',
        }
      },
    },
    shell: {
      multiple: {
        command: [
          'bundle',
          'bundle exec govuk-lint-sass stylesheets'
        ].join('&&')
      }
    }
  });

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

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

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
govuk_frontend_toolkit-4.18.1 app/assets/Gruntfile.js
govuk_frontend_toolkit-4.18.0 app/assets/Gruntfile.js
govuk_frontend_toolkit-4.17.0 app/assets/Gruntfile.js
govuk_frontend_toolkit-4.16.1 app/assets/Gruntfile.js
govuk_frontend_toolkit-4.16.0 app/assets/Gruntfile.js
govuk_frontend_toolkit-4.15.0 app/assets/Gruntfile.js
govuk_frontend_toolkit-4.14.1 app/assets/Gruntfile.js
govuk_frontend_toolkit-4.14.0 app/assets/Gruntfile.js
govuk_frontend_toolkit-4.13.0 app/assets/Gruntfile.js
govuk_frontend_toolkit-4.12.0 app/assets/Gruntfile.js
govuk_frontend_toolkit-4.11.0 app/assets/Gruntfile.js
govuk_frontend_toolkit-4.10.0 app/assets/Gruntfile.js
govuk_frontend_toolkit-4.9.1 app/assets/Gruntfile.js
govuk_frontend_toolkit-4.9.0 app/assets/Gruntfile.js
govuk_frontend_toolkit-4.8.2 app/assets/Gruntfile.js