Skip to content

How do I use input source maps with the compressor? #311

@tarruda

Description

@tarruda

I'm currently failing to use input source maps when compressing the ast:

uglifyAst = UglifyJS.parse(code);
//uglifyAst.figure_out_scope()
//uglifyAst = uglifyAst.transform(UglifyJS.Compressor({warnings: false});
uglifyAst.figure_out_scope();
uglifyAst.compute_char_frequency();
uglifyAst.mangle_names();
sm = UglifyJS.SourceMap({
  file: outputFile,
  root: root,
  orig: map
})
code = uglifyAst.print_to_string({source_map: sm});
map = sm.toString()

The above code works(the resulting source map works fine) but If I uncomment lines 2 and 3(compression) the resulting source map is broken. What am I doing wrong?

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions