-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGruntfile.js
More file actions
112 lines (96 loc) · 3.3 KB
/
Gruntfile.js
File metadata and controls
112 lines (96 loc) · 3.3 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
106
107
108
109
110
111
112
module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
sass: {
dist: {
files: {
'ext/css/build/main.css': 'ext/css/main.scss',
}
}
},
autoprefixer: {
options: {
browsers: ['> 0.5%', 'last 2 versions', 'Firefox ESR', 'Opera 12.1', 'Android 4', 'BlackBerry 10']
},
styles: {
src: 'ext/css/build/*.css'
}
},
cssmin: {
combine: {
files: {
'ext/css/build/style.min.css': [
'node_modules/c3/c3.css',
'ext/css/build/main.css',
]
}
}
},
clean: [
'ext/css/build/main.css',
],
jshint: {
options: {
reporter: './jshint-reporter.js',
browser: true, // We're a browser ...
devel: true, // ... that has development features \o/
strict: true, // Enforce strict mode for all functions
curly: true, // Require curly brackets for blocks
forin: true, // Require for-in loop to filter items
latedef: true, // Prevent variables being used before they are defined
undef: true, // Prevent the use of undefined variables
unused: 'vars', // Highlight unused variables (vars excludes function params)
globals: { // We made these global on purpose - false is read-only
selectedInterface: false,
c3: false
}
},
all: ['ext/jsc/*.js']
},
uglify: {
options: {
preserveComments: 'some',
sourceMap: true,
sourceMapIncludeSources: true
},
target: {
files: {
'ext/jsc/build/script.min.js': [
'node_modules/d3/d3.js',
'node_modules/c3/c3.js',
'ext/jsc/main.js'
]
}
}
},
svgstore: {
images: {
files: {
'ext/img/build/images.svg': ['ext/img/*.svg']
}
},
},
watch: {
styles: {
files: ['ext/css/*.css', 'ext/css/*.scss'],
tasks: ['style'],
},
scripts: {
files: ['ext/jsc/*.js'],
tasks: ['script']
}
}
});
grunt.loadNpmTasks('grunt-contrib-sass');
grunt.loadNpmTasks('grunt-autoprefixer');
grunt.loadNpmTasks('grunt-contrib-cssmin');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-svgstore');
grunt.loadNpmTasks('grunt-contrib-clean');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.registerTask('style', ['sass', 'autoprefixer', 'cssmin', 'clean']);
grunt.registerTask('script', ['jshint', 'uglify']);
grunt.registerTask('image', ['svgstore']);
grunt.registerTask('default', ['style', 'script', 'image']);
};