UNPKG

1.65 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 'tmp/css.css': ['test/fixtures/compile.css']
40 }
41 }
42 },
43
44 // Unit tests.
45 nodeunit: {
46 tests: ['test/*_test.js']
47 }
48 });
49
50 // Actually load this plugin's task(s).
51 grunt.loadTasks('tasks');
52
53 // These plugins provide necessary tasks.
54 grunt.loadNpmTasks('grunt-contrib-clean');
55 grunt.loadNpmTasks('grunt-contrib-jshint');
56 grunt.loadNpmTasks('grunt-contrib-nodeunit');
57 grunt.loadNpmTasks('grunt-contrib-internal');
58
59 grunt.registerTask('mkdir', grunt.file.mkdir);
60
61 // Whenever the "test" task is run, first clean the "tmp" dir, then run this
62 // plugin's task(s), then test the result.
63 grunt.registerTask('test', [
64 'clean',
65 'mkdir:tmp',
66 'sass',
67 'nodeunit',
68 'clean'
69 ]);
70
71 // By default, lint and run all tests.
72 grunt.registerTask('default', ['jshint', 'test', 'build-contrib']);
73};