-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgruntfile.js
More file actions
29 lines (27 loc) · 820 Bytes
/
gruntfile.js
File metadata and controls
29 lines (27 loc) · 820 Bytes
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
module.exports = function (grunt) {
var projectPkj = grunt.file.readJSON('package.json');
grunt.initConfig({
pkg: projectPkj,
uglify: {
my_target: {
files: {
'<%= "bin/siteExtensionUpdater." + pkg.version + ".min.js" %>': ['src/siteExtensionUpdater.js']
}
}
},
copy: {
main: {
src: 'src/siteExtensionUpdater.js',
dest: '<%= "bin/siteExtensionUpdater." + pkg.version + ".js" %>',
options: {
process: function (content, srcpath) {
return content.replace(/{projectVersion}/, projectPkj.version); // Set the version number correctly in the header
},
},
},
},
});
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.registerTask('default', ['uglify', 'copy']);
};