UNPKG

1.62 kBJavaScriptView Raw
1/*
2 * grunt-contrib-sass
3 * http://gruntjs.com/
4 *
5 * Copyright (c) 2012 Sindre Sorhus, contributors
6 * Licensed under the MIT license.
7 */
8
9'use strict';
10
11module.exports = function(grunt) {
12 // Project configuration.
13 grunt.initConfig({
14 jshint: {
15 all: [
16 'Gruntfile.js',
17 'tasks/*.js',
18 '<%= nodeunit.tests %>'
19 ],
20 options: {
21 jshintrc: '.jshintrc'
22 }
23 },
24
25 // Before generating any new files, remove any previously-created files.
26 clean: {
27 test: [
28 'tmp',
29 '.sass-cache'
30 ]
31 },
32
33 // Configuration to be run (and then tested).
34 sass: {
35 compile: {
36 files: {
37 'tmp/scss.css': ['test/fixtures/compile.scss'],
38 'tmp/sass.css': ['test/fixtures/compile.sass']
39 }
40 }
41 },
42
43 // Unit tests.
44 nodeunit: {
45 tasks: ['test/*_test.js']
46 }
47 });
48
49 // Actually load this plugin's task(s).
50 grunt.loadTasks('tasks');
51
52 // These plugins provide necessary tasks.
53 grunt.loadNpmTasks('grunt-contrib-clean');
54 grunt.loadNpmTasks('grunt-contrib-jshint');
55 grunt.loadNpmTasks('grunt-contrib-nodeunit');
56 grunt.loadNpmTasks('grunt-contrib-internal');
57
58 grunt.registerTask('mkdir', function(dir) {
59 require('fs').mkdirSync(dir);
60 });
61
62 // Whenever the "test" task is run, first clean the "tmp" dir, then run this
63 // plugin's task(s), then test the result.
64 grunt.registerTask('test', [
65 'clean',
66 'mkdir:tmp',
67 'sass',
68 'nodeunit',
69 'clean'
70 ]);
71
72 // By default, lint and run all tests.
73 grunt.registerTask('default', ['test', 'build-contrib']);
74};