2013-05-15 21:19:08 +02:00
|
|
|
/*
|
2013-05-15 23:46:12 +02:00
|
|
|
* grunt-datauri
|
|
|
|
|
* https://github.com/ceee/grunt-datauri
|
2013-05-15 21:19:08 +02:00
|
|
|
*
|
|
|
|
|
* Copyright (c) 2013 Tobias Klika
|
|
|
|
|
* Licensed under the MIT license.
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
'use strict';
|
|
|
|
|
|
|
|
|
|
module.exports = function (grunt) {
|
|
|
|
|
grunt.initConfig({
|
2013-05-26 19:08:58 +02:00
|
|
|
|
2013-05-15 21:19:08 +02:00
|
|
|
jshint: {
|
2013-05-26 19:08:58 +02:00
|
|
|
default: {
|
|
|
|
|
all: [
|
|
|
|
|
'Gruntfile.js',
|
|
|
|
|
'tasks/*.js',
|
|
|
|
|
'<%= nodeunit.tests %>'
|
|
|
|
|
],
|
|
|
|
|
options: {
|
|
|
|
|
jshintrc: '.jshintrc'
|
|
|
|
|
}
|
2013-05-15 21:19:08 +02:00
|
|
|
}
|
|
|
|
|
},
|
2013-05-26 19:08:58 +02:00
|
|
|
|
2013-05-15 21:19:08 +02:00
|
|
|
clean: {
|
|
|
|
|
test: ['tmp']
|
|
|
|
|
},
|
2013-05-26 19:08:58 +02:00
|
|
|
|
2013-05-15 21:19:08 +02:00
|
|
|
nodeunit: {
|
|
|
|
|
tasks: ['test/*_test.js']
|
2013-05-15 22:30:57 +02:00
|
|
|
},
|
2013-05-26 19:08:58 +02:00
|
|
|
|
2013-05-15 22:30:57 +02:00
|
|
|
// Configuration to be run (and then tested).
|
2013-05-15 23:46:12 +02:00
|
|
|
datauri: {
|
2013-05-15 22:30:57 +02:00
|
|
|
default: {
|
2013-05-26 19:08:58 +02:00
|
|
|
options: {
|
|
|
|
|
classPrefix: 'data-'
|
|
|
|
|
},
|
|
|
|
|
src: [
|
|
|
|
|
"test/fixtures/test-png.png",
|
|
|
|
|
"test/fixtures/test-gif.gif",
|
|
|
|
|
"test/fixtures/test-jpg.jpg",
|
|
|
|
|
"test/fixtures/test-bmp.bmp"
|
|
|
|
|
],
|
|
|
|
|
dest: [
|
|
|
|
|
"tmp/base64.css",
|
|
|
|
|
"tmp/base64.sass",
|
|
|
|
|
"tmp/base64.scss"
|
|
|
|
|
]
|
2013-10-29 22:54:56 -06:00
|
|
|
},
|
|
|
|
|
|
|
|
|
|
variables_option: {
|
|
|
|
|
options: {
|
|
|
|
|
classPrefix: 'data-',
|
|
|
|
|
variables: true
|
|
|
|
|
},
|
|
|
|
|
src: [
|
|
|
|
|
"test/fixtures/test-png.png",
|
|
|
|
|
"test/fixtures/test-gif.gif",
|
|
|
|
|
"test/fixtures/test-jpg.jpg",
|
|
|
|
|
"test/fixtures/test-bmp.bmp"
|
|
|
|
|
],
|
|
|
|
|
dest: [
|
|
|
|
|
"tmp/base64.variables.scss",
|
|
|
|
|
"tmp/base64.variables.sass"
|
|
|
|
|
]
|
2013-05-26 19:08:58 +02:00
|
|
|
}
|
2013-05-15 21:19:08 +02:00
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
grunt.loadTasks('tasks');
|
|
|
|
|
|
|
|
|
|
grunt.loadNpmTasks('grunt-contrib-clean');
|
|
|
|
|
grunt.loadNpmTasks('grunt-contrib-jshint');
|
|
|
|
|
grunt.loadNpmTasks('grunt-contrib-nodeunit');
|
|
|
|
|
grunt.loadNpmTasks('grunt-contrib-internal');
|
|
|
|
|
|
|
|
|
|
grunt.registerTask('mkdir', grunt.file.mkdir);
|
2013-05-26 19:08:58 +02:00
|
|
|
|
2013-05-16 16:22:59 +02:00
|
|
|
grunt.registerTask('test', [ 'clean', 'mkdir:tmp', 'datauri', 'nodeunit', 'clean' ]);
|
2013-05-26 19:08:58 +02:00
|
|
|
|
2013-05-16 16:22:59 +02:00
|
|
|
grunt.registerTask('default', [ 'datauri' ]);
|
2013-05-15 21:19:08 +02:00
|
|
|
};
|