mirror of
https://github.com/zulip/zulip.git
synced 2025-11-13 02:17:19 +00:00
Identify app.js source map using a special comment
If we're going to minify third party code, the size heuristic may not hold anymore. (imported from commit 78ada1fee1446e78b3b1ad299ee3e975d1cd9002)
This commit is contained in:
committed by
Zev Benjamin
parent
5aafdc7cf9
commit
371d0dbaa0
@@ -12,13 +12,11 @@ class ClosureSourceMapCompressor(SubProcessCompressor):
|
||||
# easily get either the input file names or the output file
|
||||
# name. So we just pick a unique arbitrary name. This is
|
||||
# okay because we can figure out from the source map file
|
||||
# contents which JavaScript files it corresponds to.
|
||||
# contents which JavaScript files it corresponds to. But we
|
||||
# use a special comment to identify app.js, so that automatic
|
||||
# source mapping works.
|
||||
|
||||
# As a hack to make things easier, assume that any large input
|
||||
# corresponds to app.js. This is like 60 times bigger than
|
||||
# any other input file, at present.
|
||||
|
||||
if len(js) > 100000:
|
||||
if 'MINIFY-FILE-ID: zephyr.js' in js:
|
||||
source_map_name = 'app.js.map'
|
||||
else:
|
||||
source_map_name = sha1(js).hexdigest() + '.map'
|
||||
|
||||
Reference in New Issue
Block a user