-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGruntfile.js
99 lines (98 loc) · 2.93 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
module.exports = function (grunt) {
require('jit-grunt')(grunt);
require('time-grunt')(grunt);
grunt.initConfig({
less: {
development: {
options: {
compress: true, yuicompress: true, optimization: 2,
plugins : [ new (require('less-plugin-autoprefix'))({browsers : [ "last 2 versions" ]}) ]
},
files: {
"dist/css/style.css" : "src/less/style.less"
}
}
}, uglify: {
my_target: {
files: {
'dist/js/main.min.js': ['node_modules/jquery/dist/jquery.js', 'src/js/main.js']
}
}
}, jshint: {
files: ['Gruntfile.js', 'src/js/**/*.js'],
options: {
esnext: true,
globals: {
jQuery: true
}
}
}, minifyHtml: {
options: {
cdata: true
},
dist: {
files: {
'dist/index.html': 'src/html/index.htm'
}
}
}, watch: {
styles: {
files: ['src/less/**/*.less'], // which files to watch
tasks: ['less'],
options: {
nospawn: true
}
}
}, concurrent: {
html: ['newer:minifyHtml'],
js: ['newer:jshint', 'newer:uglify'],
css: ['newer:less']
}, connect: {
server: {
options: {
port: 9001,
base: 'dist',
keepalive: true
}
}
}, copy: {
main: {
expand: true,
cwd: 'dist',
src: '**',
dest: 'docs/'
}
}
/*
webfont: { // Erstellt im Buildprozess eine Schriftart aus SVG-Dateien
icons: {
src: '../../temp/*.svg',
dest: '../../' + grunt.option('dest'),
options: {
fontFilename: 'icons',
stylesheet: 'less',
htmlDemo: 'true',
relativeFontPath: '/'+grunt.option('dest'),
template: 'grunt-webfont-template.css'
}
}
}, svgstore: { // SVG Sprite erstellen. Wird bisher wenn überhaupt nur manuell ausgeführt
default: {
files: {
'dest/dest.svg': ['../../temp/*.svg'],
},
},
options: {
includedemo: true,
inheritviewbox: true,
svg: {
xmlns: 'http://www.w3.org/2000/svg'
}
}
}*/
});
//grunt.registerTask('svgsprite', ['svgstore']);
grunt.registerTask('default', ['concurrent:html', 'concurrent:js', 'concurrent:css']);
grunt.registerTask('publish', ['copy']);
grunt.registerTask('server', ['connect']);
};