mirror of
				https://github.com/zulip/zulip.git
				synced 2025-10-31 20:13:46 +00:00 
			
		
		
		
	static: Restore bundling KaTeX and zxcvbn via django-pipeline.
Since we need KaTeX to be available for zerver/lib/tex.py and static/third/katex/cli.js to be able to shell out to it. However, for some reason, the KaTeX we bundle using Webpack doesn't seem to be importable by Node (and it's also kinda a pain to find its filename from `cli.js`). So, we work around this by just using the legacy system for KaTeX. Something similar is needed for zxcvbn.js, in order to support the settings_account.js use case (basically deferred loading of this file); that requires JS code to have access to the correct path for zxcvbn.
This commit is contained in:
		| @@ -1114,7 +1114,28 @@ JS_SPECS = { | |||||||
|     'sockjs': { |     'sockjs': { | ||||||
|         'source_filenames': ['third/sockjs/sockjs-0.3.4.js'], |         'source_filenames': ['third/sockjs/sockjs-0.3.4.js'], | ||||||
|         'output_filename': 'min/sockjs-0.3.4.min.js' |         'output_filename': 'min/sockjs-0.3.4.min.js' | ||||||
|     } |     }, | ||||||
|  |     # Even though we've moved the main KaTeX copy into Webpack, we | ||||||
|  |     # also need KaTeX to be runnable directly via Node (Called from | ||||||
|  |     # zerver/lib/tex.py which calls static/third/katex/cli.js.  Since | ||||||
|  |     # our Webpack setup doesn't provide a good way to name the current | ||||||
|  |     # version of a module, we use the legacy django-pipeline system | ||||||
|  |     # for bundling KaTeX. | ||||||
|  |     'katex': { | ||||||
|  |         'source_filenames': [ | ||||||
|  |             'node_modules/katex/dist/katex.js', | ||||||
|  |         ], | ||||||
|  |         'output_filename': 'min/katex.js', | ||||||
|  |     }, | ||||||
|  |     # The same legacy treatment is required for zxcvbn, in order to | ||||||
|  |     # support the settings_account.js use case (where we don't have a | ||||||
|  |     # good way to look up the path to the file). | ||||||
|  |     'zxcvbn': { | ||||||
|  |         'source_filenames': [ | ||||||
|  |             'node_modules/zxcvbn/dist/zxcvbn.js', | ||||||
|  |         ], | ||||||
|  |         'output_filename': 'min/zxcvbn.js' | ||||||
|  |     }, | ||||||
| } | } | ||||||
|  |  | ||||||
| app_srcs = JS_SPECS['app']['source_filenames'] | app_srcs = JS_SPECS['app']['source_filenames'] | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user