-
Notifications
You must be signed in to change notification settings - Fork 203
Generate Source-Map w/ Closure Compiler #45
Comments
++ it'll need a fresh build of the closure compiler jar.. but dont see why not. also you can now do inline base64 sourcemaps, fwiw.. http://trac.webkit.org/changeset/111389 |
+++ I'm planning on playing catch up with issues here next week. I'm heading to India and there's only so much reading/sleeping I can do on the plane and in airports. I'll add this on the front of my queue since it's cool |
Rob, I've already played around a little bit with it. Will see what I can do until next week. Nothing pushed yet, but it will appear here. |
Thanks! I'm really excited for the trip. Both to see India itself and then to meet a bunch of people. I'll be meeting many Indian Sapient colleagues in person for the first time and then will also be presenting to a bunch of people from outside Sapient so it will be a great intro to the tech community in the NCR region. Definitely let me know how it goes with the feature. |
After playing around a little bit yesterday I had the feeling I came up with the commits over here. My test was: build from three scripts (plugins.js, somescript.js, script.js), all scripts were minified, somescript.js was not concatenated. |
I started to look into this. We just solved the script concatenation holy grail, so I don't really want to revisit how we're doing it any time soon. This might be harder than just plugging in the latest version of Closure Compiler. The default way to generate one of these relies on concatenation in Closure Compiler. We're not doing that so... back to the drawing board. I really want this as a feature though so we'll have to sort it out somehow. |
Revisit. |
Revisited. So... this is weird and I don't have a straightforward answer. @drublic your code works and could be built off of except for one diabolical issue- the issue that has me stumped (so far.) Your code: <apply executable="java" parallel="false">
<fileset dir="${dir.source}/${dir.js}" excludes="${file.js.bypass}, **/*.min.js" includes="**/*.js">
<exclude name="${dir.js}/otherscripts-concat.js"/>
<exclude name="${dir.js}/scripts-concat.js"/>
</fileset>
<arg line="-jar"/>
<arg path="./${dir.build.tools}/${tool.compiler}"/>
<arg line="--js"/>
<srcfile/>
<arg line="--compilation_level" />
<arg value="${scripts.compilation.level}" />
<arg line="--warning_level" />
<arg value="${scripts.compilation.warninglevel}" />
<arg line="--create_source_map" />
<arg value="${basedir}/${dir.intermediate}/${dir.js}/source_map.js.map" />
<arg line="--source_map_format=V3"/>
<arg line="--js_output_file" />
<mapper type="glob" from="*.js" to="${basedir}/${dir.intermediate}/${dir.js}/*.js"/>
<targetfile/>
</apply> ...creates a single map file my understanding is that it should produce one _.js.map file for _each* file in the directory so that every file is mapped to a corresponding source JS when people inspect the code. I think this would work correctly concatenated as long as the source files were available to browse on the server. The problem is, there's no way (that I've seen) to do the same kind of filename mapping seen in the Dear Github people, I am open to suggestions. |
Updating: Unless someone else comes in with a heroic pull request I'm pushing this out to a later release. I can do this using the Still holding out hope for a hero :) |
@roblarsen do you eventually concatenate the minified files for which a mapsource has been produced? I am having a problem when doing that as the sourcemaps become invalid for the produced concatenated file... irrelevant: i guess you don't consider integrating grunt ha? |
old... and I'm not going to revisit this myself. |
Do you think it's useful and possible to integrate the building of a source-map for JS-Files with Closure Compiler as described over here?
I think this is very helpful for everyone using the Ant Build Script.
The text was updated successfully, but these errors were encountered: