-
Notifications
You must be signed in to change notification settings - Fork 2
/
gruntfile.js
61 lines (60 loc) · 2.23 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
module.exports = function(grunt) {
var license = grunt.file.read('LICENSE');
var githubUrl = 'https://github.com/akopachov/mini-linq-js';
grunt.initConfig({
copy: {
core: {
src: 'src/mini-linq.js',
dest: 'dist/mini-linq.min.js',
options: {
process: function (content, srcpath) {
return content.replace('/* ADDITIONAL_ATTACHMENTS */', '');
}
}
},
coreAndLazy: {
src: 'src/mini-linq.js',
dest: 'dist/mini-linq.with-lazy.min.js',
options: {
process: function (content, srcpath) {
return content.replace('/* ADDITIONAL_ATTACHMENTS */', grunt.file.read('src/mini-linq.lazy.js'));
}
}
},
coreAndKnockout: {
src: 'src/mini-linq.js',
dest: 'dist/mini-linq.with-knockout.min.js',
options: {
process: function (content, srcpath) {
return content.replace('/* ADDITIONAL_ATTACHMENTS */', grunt.file.read('src/mini-linq.knockout.js'));
}
}
},
full: {
src: 'src/mini-linq.js',
dest: 'dist/mini-linq.full.min.js',
options: {
process: function (content, srcpath) {
return content.replace('/* ADDITIONAL_ATTACHMENTS */', grunt.file.read('src/mini-linq.lazy.js') + grunt.file.read('src/mini-linq.knockout.js'));
}
}
}
},
uglify: {
options: {
preserveComments: false,
banner: '/* ! ' + githubUrl + ' */\n/* !\n' + license + '\n */\n'
},
build: {
files: [{
expand: true,
cwd: 'dist/',
src: '*.js',
dest: 'dist/'
}]
}
}
});
require('matchdep').filterDev('grunt-*').forEach(grunt.loadNpmTasks);
grunt.registerTask('default', ['copy', 'uglify']);
};