-
-
Notifications
You must be signed in to change notification settings - Fork 14
/
Gruntfile.js
59 lines (54 loc) · 1.73 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
'use strict';
module.exports = function (grunt) {
const indentLines = function (src) {
return src.split('\n').map(function (line) {
return line ? ' ' + line : line;
}).join('\n');
};
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
concat: {
options: {
separator: ';'
},
web: {
src: [
'theme/sources/js/vendor/jquery.js',
'theme/sources/js/script.js'
],
dest: 'theme/public/js/script.js'
},
cuttingEdgeAjax: {
options: {
banner: '(function () {\n',
footer: '\n window.VPWebMentionEndpoint = publicMethods;\n findNewInjectionPoints();\n}());\n',
process: indentLines
},
src: ['theme/sources/js/cutting-edge.js'],
dest: 'theme/public/js/cutting-edge.js'
}
// cuttingEdgeTemplate: {
// options: {
// banner: '(function (mentions, interactions, options) {\n',
// footer: '}(\\<%= JSON.stringify(mentions) %\\>, \\<%= JSON.stringify(interactions) %\\>, \\<%= JSON.stringify(options) %\\>));\n',
// process: indentLines,
// },
// src: ['theme/sources/js/cutting-edge.js'],
// dest: 'theme/templates/cutting-edge-embed.html'
// }
},
uglify: {
dist: {
files: {
'theme/public/js/script.js': ['theme/public/js/script.js'],
'theme/public/js/cutting-edge.js': ['theme/public/js/cutting-edge.js']
}
}
}
});
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.registerTask('build-dev', ['concat']);
grunt.registerTask('build', ['concat', 'uglify']);
grunt.registerTask('default', ['build-dev']);
};