forked from MicrosoftEdge/css-usage
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gruntfile.js
42 lines (40 loc) · 1.15 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
module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
concat: {
src: {
src: [
'src/lodash.js',
'src/cssShorthands.js',
'src/fwks/*',
'src/fwkUsage.js',
'src/patterns.js',
'src/patternUsage.js',
'src/htmlUsage.js',
'src/cssUsage.js',
'src/recipes/*',
'src/crawl/prepareTsv.js',
'src/init.js'
],
dest: 'cssUsage.src.js'
}
},
strip_code: {
options: {
patterns: [
/currentRowTemplate.push\(\'(css|dom|html)\'\);/g,
/convertToTSV\(INSTRUMENTATION_RESULTS\[\'(css|dom|html)\'\]\);[\n\r]+\s+currentRowTemplate.pop\(\);/g
]
},
your_target: {
files: [
{src: 'cssUsage.src.js', dest: 'Recipe.min.js'}
]
}
}
});
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-strip-code');
grunt.registerTask('default', ['concat', 'strip_code']);
};