Added notice in the event that UglifyJS is unavailable
parent
eed9465885
commit
b3455abcb9
|
@ -6,11 +6,29 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// uses UglifyJS
|
// uses UglifyJS
|
||||||
var parser = require( 'uglify-js' ).parser,
|
var uglify,
|
||||||
uglify = require( 'uglify-js' ).uglify,
|
FILE_ROOT = '../build/';
|
||||||
|
|
||||||
FILE_ROOT = '../build/'
|
try
|
||||||
;
|
{
|
||||||
|
// attempt to load UglifyJS
|
||||||
|
var uglify = require( 'uglify-js' );
|
||||||
|
}
|
||||||
|
catch ( e )
|
||||||
|
{
|
||||||
|
// if there's a problem loading it, let the user know what they probably
|
||||||
|
// need to do
|
||||||
|
process.stderr.write(
|
||||||
|
"Unable to located UglifyJS. Please run:\n\n" +
|
||||||
|
" $ npm install uglify-js\n\n" +
|
||||||
|
"and then try again.\n"
|
||||||
|
);
|
||||||
|
|
||||||
|
process.exit( 1 );
|
||||||
|
}
|
||||||
|
|
||||||
|
var parser = uglify.parser,
|
||||||
|
uglify = uglify.uglify;
|
||||||
|
|
||||||
// we should receive the file via stdin
|
// we should receive the file via stdin
|
||||||
var data = '';
|
var data = '';
|
||||||
|
|
Loading…
Reference in New Issue