-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGruntfile.js
37 lines (33 loc) · 1.07 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
module.exports = function(grunt) {
'use strict';
var pkg = grunt.file.readJSON('bower.json'),
banner = '/* trolley.js v' + pkg.version + ' - https://github.com/BorePlusPlus/trolley.js - Copyright (c) 2013, Dalibor "BorePlusPlus" Novak, License: BSD 3-clause */',
bannerRegex = /\/\* trolley\.js.*/;
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.initConfig({
uglify: {
options: {
report: 'gzip',
banner: banner + '\n'
},
build: {
files: {
'dist/trolley.min.js': 'lib/trolley.js'
}
}
},
copy: {
options: {
processContent: function (content) {
return content.replace(bannerRegex, banner);
}
},
build: {
src: 'lib/trolley.js',
dest: 'dist/trolley.js'
}
}
});
grunt.registerTask('default', ['uglify', 'copy']);
};