Is there any way to reverse javascript minification?

Asked

Viewed 258 times

2

Once the file has been minified using, for example, the uglifyJS it is possible to make it readable again?

If yes, how?

Obs: Use of the GulpJS as task Runner

  • 2

    IS that you’re looking for?

  • 1

    You can return the identation. Already the name of the variables and functions can not.

2 answers

4

Having a minified file there is no way to know which name the variables and functions had before.

It is possible to reformat the indentation to be correct, but not "guess" the old names.

To reformat, using the Gulp, I found this plugin (Gulp-indent).

var indent = require("gulp-indent");

gulp.src("./src/*.ext")
    .pipe(indent({
        tabs:true,
    amount:1
    }))
    .pipe(gulp.dest("./dist"));

0

If you just want to reverse the minification for debugging purposes, the debuggers of Chrome and firefox are able to reindentify the minified code for you.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.