Max-Age für den Development-Server auf 0s gesetzt
[website] / Gruntfile.js
1 module.exports = function (grunt) {
2   'use strict';
3
4   grunt.loadNpmTasks('grunt-contrib-clean');
5   grunt.loadNpmTasks('grunt-contrib-cssmin');
6   grunt.loadNpmTasks('grunt-contrib-less');
7   grunt.loadNpmTasks('grunt-contrib-watch');
8   grunt.loadNpmTasks('grunt-newer');
9
10   grunt.initConfig({
11
12     clean: {
13       css: [ 'dist/css' ]
14     },
15
16     less: {
17       base: {
18         options: {
19           strictMath: true,
20           sourceMap: true,
21           outputSourceFiles: true,
22           sourceMapURL: 'base.css.map',
23           sourceMapFilename: 'dist/css/base.css.map'
24         },
25         src: 'dist/less/base.less',
26         dest: 'dist/css/base.css'
27       },
28       screen: {
29         options: {
30           strictMath: true,
31           sourceMap: true,
32           outputSourceFiles: true,
33           sourceMapURL: 'screen.css.map',
34           sourceMapFilename: 'dist/css/screen.css.map'
35         },
36         src: 'dist/less/screen.less',
37         dest: 'dist/css/screen.css'
38       },
39       print: {
40         options: {
41           strictMath: true,
42           sourceMap: true,
43           outputSourceFiles: true,
44           sourceMapURL: 'print.css.map',
45           sourceMapFilename: 'dist/css/print.css.map'
46         },
47         src: 'dist/less/print.less',
48         dest: 'dist/css/print.css'
49       },
50       ie8: {
51         options: {
52           strictMath: true,
53           sourceMap: true,
54           outputSourceFiles: true,
55           sourceMapURL: 'ie8.css.map',
56           sourceMapFilename: 'dist/css/ie8.css.map'
57         },
58         src: 'dist/less/ie8.less',
59         dest: 'dist/css/ie8.css'
60       },
61       tablet: {
62         options: {
63           strictMath: true,
64           sourceMap: true,
65           outputSourceFiles: true,
66           sourceMapURL: 'tablet.css.map',
67           sourceMapFilename: 'dist/css/tablet.css.map'
68         },
69         src: 'dist/less/tablet.less',
70         dest: 'dist/css/tablet.css'
71       },
72       phone: {
73         options: {
74           strictMath: true,
75           sourceMap: true,
76           outputSourceFiles: true,
77           sourceMapURL: 'phone.css.map',
78           sourceMapFilename: 'dist/css/phone.css.map'
79         },
80         src: 'dist/less/phone.less',
81         dest: 'dist/css/phone.css'
82       },
83       tiny: {
84         options: {
85           strictMath: true,
86           sourceMap: true,
87           outputSourceFiles: true,
88           sourceMapURL: 'tiny.css.map',
89           sourceMapFilename: 'dist/css/tiny.css.map'
90         },
91         src: 'dist/less/tiny.less',
92         dest: 'dist/css/tiny.css'
93       },
94       seitenaufteilung: {
95         options: {
96           strictMath: true,
97           sourceMap: true,
98           outputSourceFiles: true,
99           sourceMapURL: 'seitenaufteilung.css.map',
100           sourceMapFilename: 'dist/css/seitenaufteilung.css.map'
101         },
102         src: 'dist/less/seitenaufteilung.less',
103         dest: 'dist/css/seitenaufteilung.css'
104       },
105       seitenkopf: {
106         options: {
107           strictMath: true,
108           sourceMap: true,
109           outputSourceFiles: true,
110           sourceMapURL: 'seitenkopf.css.map',
111           sourceMapFilename: 'dist/css/seitenkopf.css.map'
112         },
113         src: 'dist/less/seitenkopf.less',
114         dest: 'dist/css/seitenkopf.css'
115       }
116     },
117
118     cssmin: {
119       options: {
120         compatibility: 'ie8',
121         sourceMap: true,
122         advanced: false
123       },
124       base: {
125         src: 'dist/css/base.css',
126         dest: 'dist/css/base.min.css'
127       },
128       screen: {
129         src: 'dist/css/screen.css',
130         dest: 'dist/css/screen.min.css'
131       },
132       print: {
133         src: 'dist/css/print.css',
134         dest: 'dist/css/print.min.css'
135       },
136       ie8: {
137         src: 'dist/css/ie8.css',
138         dest: 'dist/css/ie8.min.css'
139       },
140       tablet: {
141         src: 'dist/css/tablet.css',
142         dest: 'dist/css/tablet.min.css'
143       },
144       phone: {
145         src: 'dist/css/phone.css',
146         dest: 'dist/css/phone.min.css'
147       },
148       tiny: {
149         src: 'dist/css/tiny.css',
150         dest: 'dist/css/tiny.min.css'
151       },
152       seitenaufteilung: {
153         src: 'dist/css/seitenaufteilung.css',
154         dest: 'dist/css/seitenaufteilung.min.css'
155       },
156       seitenkopf: {
157         src: 'dist/css/seitenkopf.css',
158         dest: 'dist/css/seitenkopf.min.css'
159       }
160     },
161
162     watch: {
163       css: {
164         files: [ 'dist/less/**/*.less' ],
165         tasks: 'css'
166       }
167     }
168
169   })
170
171
172   // Task to build and minify the CSS
173   grunt.registerTask('css', [ 'less', 'newer:cssmin' ]);
174
175   // Task to build the distribution
176   grunt.registerTask('dist', [ 'css' ]);
177
178
179   // Task to start a local http-server for development
180   grunt.registerTask('http-server', function() {
181
182     grunt.util.spawn({
183       cmd: 'node_modules/http-server/bin/http-server',
184       args: [ 'dist', '-c0' ],
185       opts: { stdio: 'inherit' }
186     });
187
188   });
189
190   // Task to start development-environment
191   grunt.registerTask('devel', [ 'dist', 'http-server', 'watch' ]);
192
193
194   // Default task.
195   grunt.registerTask('default', [ 'dist' ]);
196
197 }