-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathgruntfile.js
63 lines (60 loc) · 1.45 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
module.exports = function(grunt) {
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-text-replace');
grunt.loadNpmTasks('grunt-closure-tools');
grunt.initConfig({
files : {
name : "sg"
},
replace: {
portal: {
src: "build/portal/suggests.html",
dest: "dist/portal/",
replacements: [
{
from: "@@script_src",
to: "./sg.js"
}
]
}
},
concat : {
lib: {
src: [
"lib/sg.core.js",
"lib/sg.yass.js",
"lib/sg.when.js",
"lib/sg.event.js",
"lib/sg.ajax2.js",
"lib/sg.tmpl.js"
],
dest: "<%= files.name %>.js"
},
portal: {
src: ["<%= concat.lib.dest %>", "build/portal/sg_config.js"],
dest: "dist/portal/<%= files.name %>.js"
}
},
closureCompiler: {
options: {
compilerFile: "./libexec/closure/build/compiler.jar"
},
lib: {
src: "<%= concat.lib.dest %>",
dest: "<%= files.name %>.min.js"
},
portal: {
src: "<%= concat.portal.dest %>",
dest: "dist/portal/<%= files.name %>.min.js"
}
}
});
grunt.registerTask("lib", ["concat:lib", "closureCompiler:lib"]);
grunt.registerTask("portal", [
"concat:lib",
"concat:portal",
"closureCompiler:portal",
"replace:portal"
]);
grunt.registerTask("default", ["lib"]);
};