-
Notifications
You must be signed in to change notification settings - Fork 11
/
minifing.js
33 lines (30 loc) · 1.07 KB
/
minifing.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
var compressor = require('node-minify');
// Using Google Closure with jQuery 2.0
new compressor.minify({
type: 'no-compress',
language: 'ECMASCRIPT5',
fileIn: ['libs/vjavascript.js','libs/base64.js', 'libs/v7_render.js', 'libs/handlebars.js', 'libs/cirrus.js'],
fileOut: 'builds/cirrus.min.test.js',
callback: function(err){
console.log(err);
}
});
new compressor.minify({
type: 'gcc',
language: 'ECMASCRIPT5',
fileIn: ['libs/v7_render.js', 'libs/cirrus.js'],
fileOut: 'builds/cirrus.min.js',
callback: function(err){
var fs = require('fs');
fs.readFile("builds/cirrus.min.js", 'utf8', function (err,data) {
if (err) {
return console.log(err);
}
var result = data.replace(/module\.exports\=wApp\;/, '');
fs.writeFile("builds/cirrus.min.js", result, 'utf8', function (err) {
if (err) return console.log(err);
});
});
console.log(err);
}
});