Skip to content

Commit

Permalink
Replace Uglify.js with Google Closure Compiler, JS version; let NPM f…
Browse files Browse the repository at this point in the history
…inally reformat package.json the way it likes (#4376)
  • Loading branch information
GeoffreyBooth authored Nov 29, 2016
1 parent ac20f66 commit ac26360
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
8 changes: 6 additions & 2 deletions Cakefile
Original file line number Diff line number Diff line change
Expand Up @@ -169,10 +169,14 @@ task 'build:browser', 'rebuild the merged script for inclusion in the browser',
}(this));
"""
unless process.env.MINIFY is 'false'
{code} = require('uglify-js').minify code, fromString: true
{compiledCode} = require('google-closure-compiler-js').compile
jsCode: [
src: code
languageOut: if majorVersion is 1 then 'ES5' else 'ES6'
]
outputFolder = "docs/v#{majorVersion}/browser-compiler"
fs.mkdirSync outputFolder unless fs.existsSync outputFolder
fs.writeFileSync "#{outputFolder}/coffee-script.js", header + '\n' + code
fs.writeFileSync "#{outputFolder}/coffee-script.js", header + '\n' + compiledCode
console.log "built ... running browser tests:"
invoke 'test:browser'

Expand Down
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
],
"preferGlobal": true,
"scripts": {
"test": "node ./bin/cake test",
"test": "node ./bin/cake test",
"test-harmony": "node --harmony ./bin/cake test"
},
"homepage": "http://coffeescript.org",
Expand All @@ -39,10 +39,10 @@
"url": "git://github.com/jashkenas/coffeescript.git"
},
"devDependencies": {
"uglify-js": "~2.7",
"jison": ">=0.4.17",
"docco": "~0.7.0",
"google-closure-compiler-js": "^20161024.0.0",
"highlight.js": "~9.8.0",
"underscore": "~1.8.3",
"docco": "~0.7.0"
"jison": ">=0.4.17",
"underscore": "~1.8.3"
}
}

0 comments on commit ac26360

Please sign in to comment.