forked from CSCfi/justus-frontend
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gruntfile.js
74 lines (68 loc) · 1.53 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
'use strict';
module.exports = function (grunt) {
require('load-grunt-tasks')(grunt);
require('time-grunt')(grunt);
var distDir = 'dist';
grunt.initConfig({
clean: {
files: distDir,
options: {
force: true
}
},
useminPrepare: {
html: ['src/index.html','src/justus.html','src/omat.html','src/julkaisut.html'],
options: {
dest: distDir,
flow: {
steps: {
'css': ['concat'],
'js': ['concat']
},
post: {}
}
}
},
usemin: {
html: [distDir+'/index.html',distDir+'/justus.html',distDir+'/omat.html',distDir+'/julkaisut.html']
},
copy: {
src: {
expand: true,
cwd: 'src',
src: [
'./**/*.html',
//usemin+concat: 'js/*',
'css/*',
'img/*'
],
dest: distDir,
options : {
noProcess: '**/*.{png,gif,jpg,ico,svg}',
process: function (content) {
return content.replace(/<!--dev-->.*<!--enddev-->/g, '')
.replace(/<!-- mustache/g, '')
.replace(/end mustache -->/g, '');
}
}
},
fonts: {
expand: true,
flatten: true,
cwd: 'src/bower_components',
src: ['**/*.{ttf,woff,woff2,eot,svg,otf}'],
dest: distDir + '/fonts'
}
}
});
grunt.registerTask('default', [
'build'
]);
grunt.registerTask('build', [
'clean',
'useminPrepare',
'concat',
'copy',
'usemin'
]);
};