From 132686b4a77d577942d199cf03b5f37985310773 Mon Sep 17 00:00:00 2001 From: Guillaume Beraudo Date: Thu, 11 Sep 2014 12:11:14 +0200 Subject: [PATCH] Generate source map of minified ol.js Allows automatic unminification by the browser. A postprocessing is required to: - fix the paths to the sources; - add the link from the minified script to its map. If someone knows how to do the first item in Python or nodejs, please provide a patch. A simple shell script is: ``` \#!/bin/sh pwd=`pwd` sed -i "s!$pwd/build!olsource!g" 'build/ol.js.map' sed -i "s!$pwd!olsource!g" 'build/ol.js.map' ``` The second item should always be manually handled to avoid 404 errors in debuggers `echo '//# sourceMappingURL=ol.js.map' >> build/ol.js` Finally, create an alias / copy ol3 directory to /olsource in your deployed environment. --- config/ol.json | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/config/ol.json b/config/ol.json index 5b09d266f6..c74879e641 100644 --- a/config/ol.json +++ b/config/ol.json @@ -61,6 +61,8 @@ "compilation_level": "ADVANCED", "warning_level": "VERBOSE", "use_types_for_optimization": true, - "manage_closure_dependencies": true + "manage_closure_dependencies": true, + "create_source_map": "build/ol.js.map", + "source_map_format": "V3" } }