-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathGruntfile.js
47 lines (43 loc) · 1.22 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
module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
uglify: {
options: {
banner: '/* <%= pkg.name %> <%= grunt.template.today("yyyy-mm-dd") %> */\n'
},
build: {
src: 'src/<%= pkg.name %>.js',
dest: 'dist/<%= pkg.name %>.min.js'
}
},
cssmin: {
target: {
files: {
'dist/<%= pkg.name %>.showcase.min.css': ['src/<%= pkg.name %>.showcase.css']
}
}
},
// svgstore is a grunt task to build a single library file form a folder of svg files
svgstore: {
default: {
files: {
'dist/libraries/sample.svg': ['libraries/sample/*.svg']
}
},
options: {
prefix : 'iconSymbol-', // This will prefix each ID
svg: {
viewBox : '0 0 470 470',
xmlns: 'http://www.w3.org/2000/svg',
id:'library',
'xmlns:xlink':'http://www.w3.org/1999/xlink'
}
}
}
});
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-cssmin');
grunt.loadNpmTasks('grunt-svgstore');
grunt.registerTask('default', ['uglify', 'cssmin']);
grunt.registerTask('libraries', ['svgstore']);
};