Opened 5 years ago

Closed 5 years ago

Last modified 5 years ago

#18341 closed feature (fixed)

Add support for source maps with UglifyJS 2 optimizer

Reported by: Thomas Bachem Owned by: ben hockey
Priority: high Milestone: 1.10.3
Component: BuildSystem Version: 1.10.2
Keywords: Cc:
Blocked By: Blocking:

Description

UglifyJS has been added as a build optimizer thru #14684, but source maps are not yet supported. UglifyJS 2 is stable and supports source maps, so it would be nice if the Dojo build scripts would make use of them.

Change History (9)

comment:1 Changed 5 years ago by ben hockey

Owner: set to Thomas Bachem
Status: newpending

this is already supported. add something like the following to your build profile.

        // find the options at https://github.com/mishoo/UglifyJS2#the-hard-way
        optimizeOptions: {
                compress_options: {},
                gen_options: {}
        },

is there something more than this which you need?

comment:2 Changed 5 years ago by Thomas Bachem

Status: pendingnew

Great, thanks for the info! I don't get how to implement it though.

I'm currently calling

node build.js --profile build.profile.js --releaseDir ... --optimize uglify --layerOptimize uglify --stripConsole all --cssOptimize comments

Now I want a ".js.map" file for every built Javascript file, so I thought of putting this in my build.profile.js:

optimizeOptions: {
	compress_options: {},
	gen_options: {
		source_map: UglifyJS.SourceMap()
	}
}

But this feels strange and leads to "error(347) Failed to evaluate profile file. profile: build.profile.js; error: ReferenceError?: UglifyJS is not defined".

I guess I'm probably doing it totally wrong.

Last edited 5 years ago by Thomas Bachem (previous) (diff)

comment:3 Changed 5 years ago by ben hockey

Owner: changed from Thomas Bachem to ben hockey
Status: newassigned

ok, i may have spoke too soon. let me work on something and see if i can get a pull request - i think there may need to be some extra support added.

comment:4 Changed 5 years ago by Thomas Bachem

Thanks a lot!

comment:5 Changed 5 years ago by ben hockey

Milestone: tbd1.11
Priority: undecidedhigh

i've opened https://github.com/dojo/util/pull/24

if you have time to try it out, i'd like to get feedback.

comment:6 Changed 5 years ago by Thomas Bachem

That's fantastic! Works well, thank you so much for this quick resolution!

comment:7 Changed 5 years ago by Colin Snover <github.com@…>

Resolution: fixed
Status: assignedclosed

In 920a75b5277b4f2a05f636d99bb5acbf52bb8229/util:

Error: Processor CommitTicketReference failed
Unsupported version control system "git": Can't find an appropriate component, maybe the corresponding plugin was not enabled? 

comment:8 Changed 5 years ago by Colin Snover <github.com@…>

In 51a1844ee3cedfc669a3ad70e1894e2e5e3e781d/util:

Error: Processor CommitTicketReference failed
Unsupported version control system "git": Can't find an appropriate component, maybe the corresponding plugin was not enabled? 

comment:9 Changed 5 years ago by Colin Snover

Milestone: 1.111.10.3
Note: See TracTickets for help on using tickets.