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.
This commit is contained in:
committed by
Éric Lemoine
parent
1f90aad4ad
commit
132686b4a7
@@ -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"
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user