forked from jakubboucek/fucking-eu-cookies
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGruntfile.js
80 lines (76 loc) · 2.16 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
module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
less: {
options: {
compress: true,
},
main: {
files: {
"dist/style.css": "source/style.less"
}
},
},
copy: {
styles: {
src: 'index.html',
dest: 'build/'
},
cz: {
src: 'source/cookies.js',
dest: 'dist/cz.js',
options: {
process: function(content, path) {
grunt.config.set('css', grunt.file.read('dist/style.css'));
grunt.config.set('l18n', grunt.file.readJSON('source/l18n.cz.json'));
grunt.config.set('options', grunt.file.readJSON('source/options.json'));
return grunt.template.process(content);
}
}
},
en: {
src: 'source/cookies.js',
dest: 'dist/en.js',
options: {
process: function(content, path) {
grunt.config.set('css', grunt.file.read('dist/style.css'));
grunt.config.set('l18n', grunt.file.readJSON('source/l18n.en.json'));
grunt.config.set('options', grunt.file.readJSON('source/options.json'));
return grunt.template.process(content);
}
}
},
sk: {
src: 'source/cookies.js',
dest: 'dist/sk.js',
options: {
process: function(content, path) {
grunt.config.set('css', grunt.file.read('dist/style.css'));
grunt.config.set('l18n', grunt.file.readJSON('source/l18n.sk.json'));
grunt.config.set('options', grunt.file.readJSON('source/options.json'));
return grunt.template.process(content);
}
}
}
},
uglify: {
options: {
banner: '/*! <%= pkg.name %> v<%= pkg.version %> <%= grunt.template.today("yyyy-mm-dd HH:MM:ss") %>\n * Copyright (c) <%= grunt.template.today("yyyy") %> <%= pkg.author.name %> (<%= pkg.author.url %>) */\n'
},
build: {
files: {
'build/cz.js': ['dist/cz.js'],
'build/en.js': ['dist/en.js'],
'build/sk.js': ['dist/sk.js']
}
}
},
});
// Load the plugin that provides the "uglify" task.
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-contrib-less');
// Default task(s).
grunt.registerTask('default', ['less','copy','uglify']);
};