forked from hebeworks/Solomon
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGruntfile.js
127 lines (114 loc) · 3.42 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
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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
/*global module:false*/
module.exports = function(grunt) {
grunt.initConfig({
/**
* Load our packagone.json file
*/
pkg: grunt.file.readJSON('package.json'),
/*
Run the Ember shell commands from the respective grunt commands
*/
shell: {
serve: {
command: 'ember serve & grunt watch:grunticon'
},
build: {
command: 'ember build --environment production'
}
},
/*
Watch for generated grunticon css
*/
watch: {
grunticon: {
files: 'public/assets/img/svg/embed/*.svg',
//files: '/vendor/embedsvg/**/*.hbs',
tasks: ['svg']
}
},
/*
Move generated grunticon css to public/assets
*/
copy: {
grunticon: {
files: [
{
expand: true,
flatten: false,
cwd: 'vendor/embedsvg/',
dest: 'public/assets/css/',
src: [
'*.css',
'png/*'
]
}
]
}
},
/*
Clean the grunticon public images folder to remove any newly deleted assets
*/
clean: {
grunticon: {
files: [{
src: [
'vendor/embedsvg/png/*',
'public/assets/css/png/*'
]
}]
}
},
/**
* Create data URIs in a CSS file for SVGs
*/
grunticon: {
nonembedsvg: {
files: [{
expand: true,
cwd: 'public/assets/img/svg/datauri',
src: '*.svg',
dest: 'public/assets/img/svg'
}],
options: {
datasvgcss: '../../../../app/styles/patterns/_svg-datauri.scss',
cssprefix: '@mixin svg--'
}
},
embed: {
files: [{
expand: true,
cwd: 'public/assets/img/svg/embed',
src: '*.svg',
dest: 'vendor/embedsvg'
}],
options: {
enhanceSVG: true,
cssprefix: '.svg-'
}
}
},
/**
* Detect which parts of Modernizr are required & build a custom Modernizr file
*/
modernizr: {
dist: {
"devFile" : "bower_components/modernizr/modernizr.js",
"outputFile" : "vendor/modernizr-custom.min.js",
"uglify" : true,
"files" : {
"src": ['app/index.html']
},
}
}
});
/**
* Generates a list of grunt tasks
*/
require('load-grunt-tasks')(grunt);
/**
* Define a workflow of tasks that will be run on deployment
*/
grunt.registerTask('svg', ['clean:grunticon', 'grunticon:embed', 'grunticon:nonembedsvg', 'copy:grunticon']);
grunt.registerTask('default', ['svg', 'shell:build']);
grunt.registerTask('serve', ['svg', 'shell:serve']);
};