-
Notifications
You must be signed in to change notification settings - Fork 3
/
Gruntfile.js
49 lines (45 loc) · 1.24 KB
/
Gruntfile.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
module.exports = function(grunt) {
'use strict';
// Project configuration.
grunt.initConfig({
jshint: {
all: [
'Gruntfile.js',
'tasks/*.js',
'<%= nodeunit.tests %>'
],
options: {
jshintrc: '.jshintrc'
}
},
// Before generating any new files, remove any previously-created files.
clean: {
tests: ['test/less/*base64*', 'test/font/*.svg', 'test/font/*.woff', 'test/font/*.eot']
},
// sample configuration
ttf2base64_and_otherfonts: {
default: {
files: [{
src : ['test/less/ico.less']//要监听的css文件
}],
options: {
dest: 'test/font',//字体文件读取&输出目录
transfer2base64type: ['ttf', 'eot', 'woff']
}
}
},
// Unit tests.
nodeunit: {
tests: ['test/test*.js']
}
});
// These plugins provide necessary tasks.
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-clean');
grunt.loadNpmTasks('grunt-contrib-nodeunit');
// Load local tasks.
grunt.loadTasks('tasks');
// Default task.
grunt.registerTask('default', ['clean', 'ttf2base64_and_otherfonts']);
grunt.registerTask('test', ['clean', 'default', 'nodeunit']);
};