Skip to content
This repository has been archived by the owner on May 25, 2020. It is now read-only.

Request for an option to output the concatenated source so uglifyjs warning can be taken care of more easily #31

Open
shiwanlin opened this issue Jan 12, 2016 · 2 comments

Comments

@shiwanlin
Copy link

Not a high priority but a nicety to have an option to output the concatenated source so uglifyjs warning can be taken care of more easily, say, in utils.js,

exports.uglify = function (js, opts, cb) {
...
    return cb(null,  stream.toString(), js);
...
}

with the source output, the line number from the uglifyjs warning can be easily found:

WARN: Non-strict equality against boolean: != true [null:3470,6]

BTW, obfuscator is a great tool!

@catdad
Copy link

catdad commented Jan 17, 2016

I took a quick look at the source, and this is already possible, as such:

var options = {}; // build options as per documentation
var obfuscator = require('obfuscator').obfuscator;
var concatenate = obfuscator.concatenate;

concatenate(options, function(err, concatenated) {
    if (err) { throw err; }

    fs.writeFileSync('concatenated.js', concatenated);
    // or, you know, do whatever you like
});

@shiwanlin
Copy link
Author

That's cool - thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants