-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgruntfileEx.txt
More file actions
106 lines (81 loc) · 2.19 KB
/
gruntfileEx.txt
File metadata and controls
106 lines (81 loc) · 2.19 KB
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
module.exports = function(grunt) {
// Load the plugins that provide the "concat" and "watch" tasks.
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-watch');
// Project configuration.
grunt.initConfig({
srcFiles: ["src/a.js", "src/b.js", "src/c.js"],
concat: {
target1: {
files: {
"build/abc.js": "<%= srcFiles %>"
}
}
},
watch: {
target1: {
files: "<%= srcFiles %>",
tasks: ["concat"]
}
}
});
// Define the default task
grunt.registerTask('default', ['concat', 'watch']);
};
/*
var fs = require('fs');
module.exports = function(grunt) {
// Do grunt-related things in here
// Load the plugin that provides the "jshint" task.
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.initConfig({
jshint: {
options: {
curly: true,
eqeqeq: true
},
target1: ['Gruntfile.js', 'js/*.js']
}
stringCheck: {
file: './js/toe.js',
string: 'console.log('
}
});
grunt.registerTask('stringCheck', function() {
//fail if configuration is not provided
grunt.config.requires('stringCheck.file');
grunt.config.requires('stringCheck.string');
//retrieve filename and load it
var file = grunt.config('stringCheck.file');
var contents = grunt.file.read(file);
//retrieve string to search for
var string = grunt.config('stringCheck.string');
if(contents.indexOf(string >= 0))
grunt.fail.warn('"' + string + '" found in "' + file + '"');
});
grunt.registerTask('log-deploy', function() {
var message = 'Deployment on ' + new Date();
fs.appendFileSync('logs/deploy.log', message + '\n');
grunt.log.writeln('Appended "' + message + '"');
});
grunt.registerTask('default', ['stringCheck']);
};
*/
/*
module.exports = function(grunt) {
// Load the plugin that provides the "jshint" task.
grunt.loadNpmTasks('grunt-contrib-jshint');
// Project configuration.
grunt.initConfig({
jshint: {
options: {
curly: true,
eqeqeq: true
},
target1: ['Gruntfile.js', 'js/*.js']
}
});
// Define the default task
grunt.registerTask('default', ['jshint']);
};
*/