From edf91a5ab2a6afa88999403af5b11b722bb0b378 Mon Sep 17 00:00:00 2001 From: Alon Levy Date: Tue, 17 Feb 2015 12:52:24 +0200 Subject: client/server: support optimizing with require.js using node run r.js built is controlled by property do-client-optimize which defaults to false. Even if the optimized main is built (single file main-built.js and source map file main-built.js.map) they are not used unless rhizi-config.conf client_optimize is set to True which causes app.js to use main-built.js and not main.js The resulting file is 687 KiloBytes large. Pretty scary, but it still loads faster this way. (from very small tests locally). This is without compression done by the server. --- src/client/app.js | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/client') diff --git a/src/client/app.js b/src/client/app.js index 3c5d4328..a3e294ac 100644 --- a/src/client/app.js +++ b/src/client/app.js @@ -19,6 +19,9 @@ } } + if (rz_config.optimized_main) { + config.paths.main = 'main-built'; + } config.urlArgs = (typeof local_config != 'undefined') && local_config.urlArgs; if (window.is_node) { -- cgit v1.3.1