This repository was archived by the owner on May 5, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathgruntfile.js
More file actions
67 lines (62 loc) · 1.89 KB
/
gruntfile.js
File metadata and controls
67 lines (62 loc) · 1.89 KB
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
63
64
65
66
67
module.exports = function (grunt) {
'use strict';
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-text-replace');
var jsFilesThirdParty = [
"node_modules/socket.io-client/dist/socket.io.js",
"node_modules/jquery/dist/jquery.js",
"node_modules/lodash/lodash.js",
"node_modules/backbone/backbone.js",
"node_modules/smoothie/smoothie.js",
"public/js/keycode.js"
];
var jsFiles = [
"public/js/sbrickchannel.model.js",
"public/js/sbrick.model.js",
"public/js/sbrickchannel.view.js",
"public/js/sbrick.view.js",
"public/js/sbrickcontroller.view.js",
"public/js/socket.js",
//"public/js/socket-mock.js",
"public/js/app.js"
];
grunt.initConfig({
uglify: {
thirdParty: {
files: {
'public/js-min/thirdparty.min.js': jsFilesThirdParty
}
},
public: {
files: {
'public/js-min/sbrickcontroller.min.js': jsFiles
}
}
},
concat: {
public: {
src: jsFiles,
dest: 'public/js-min/sbrickcontroller.min.js'
},
thirdParty: {
src: jsFilesThirdParty,
dest: 'public/js-min/thirdparty.min.js'
}
},
replace: {
keycode: {
src: 'node_modules/keycode/index.js',
dest: 'public/js/keycode.js',
replacements: [{
from: 'exports',
to: 'keycode'
}, {
from: 'module.keycode',
to: 'keycode'
}]
}
}
});
grunt.registerTask('default', 'concat:public');
};