Skip to content

Commit 882d73f

Browse files
committed
Fix build file
1 parent 7041105 commit 882d73f

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
11
node_modules/
22
*.zip
3-
*.orig
3+
*.orig
4+
5+
package-lock.json
6+
.vscode

build/build.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222

2323
var fs = require("fs");
2424
var querystring = require('querystring');
25-
var http = require('http');
25+
var https = require('https');
2626

2727
if(process.argv.indexOf("-h") >= 0 || process.argv.indexOf("--help") >= 0){
2828
console.log("Build file for shutup");
@@ -127,14 +127,15 @@ var post_data = querystring.stringify({
127127
//'compilation_level' : 'SIMPLE_OPTIMIZATIONS',
128128
'output_format': 'json',
129129
'output_info': ['compiled_code', 'errors'],
130+
'language_out': 'ES5',
130131
'language' : 'ECMASCRIPT5_STRICT',
131132
'js_code' : full
132133
});
133134

134135
// An object of options to indicate where to post to
135136
var post_options = {
136137
host: 'closure-compiler.appspot.com',
137-
port: '80',
138+
port: '443',
138139
path: '/compile',
139140
method: 'POST',
140141
headers: {
@@ -146,7 +147,7 @@ var post_options = {
146147
var chunkAcc = "";
147148

148149
// Set up the request
149-
var post_req = http.request(post_options, function(res) {
150+
var post_req = https.request(post_options, function(res) {
150151
res.setEncoding('utf8');
151152
res.on("data", function(chunk){
152153
chunkAcc += chunk;
@@ -199,7 +200,7 @@ function preCompress(shutupjs){
199200
.file("example.html", fs.readFileSync("example.html"))
200201
.file("CopyrightNotice", copyright)
201202
.file("LICENSE", fs.readFileSync(rootDir + "LICENSE"))
202-
.generate({type:"nodebuffer", compression: "DEFLATE"});
203+
.generateNodeStream({type:"nodebuffer", compression: "DEFLATE"});
203204
fs.writeFileSync(filename, blob);
204205
}
205206

0 commit comments

Comments
 (0)