From: Bill Erickson Date: Fri, 19 May 2017 19:42:40 +0000 (-0400) Subject: LP#1692097 Webstaff JS minify/concat improvements X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=31333f97c1a180d4f22ebdfe7e0c6831bf588e62;p=working%2FEvergreen.git LP#1692097 Webstaff JS minify/concat improvements * Support minifying the core Evergreen services files (i.e. service/*.js). Previously, they were only concatenated. * Create one concatenated file for external dependencies (jquery, angular, etc.) and a separate concatenated file for Evergreen core service files. Included in this is replacing the template variable EXPAND_WEB_IMPORTS with EXPAND_WEB_DEP_IMPORTS and EXPAND_WEB_CORE_IMPORTS. The thinking here is that concatenating 3rd party files (which are already minified) is an easy win and should not complicate debugging, whereas minifying and concatenating EG service files will require more testing. It's also nice that you can expand one or the other as needed for debugging. The build creates evergreen-staff-client.0.0.1.deps.min.js and evergreen-staff-client.0.0.1.core.min.js * Various fixes to the Gruntfile, including missing dependency references and fixing some faulty assumptions from early iterations of the file. * Remove OpenSRF JS from the minify/concat processes. Otherwise, we have to add some variable replacements in Gruntfile to avoid hard-coding the path to the OpenSRF js files. Not sure it's worth it for 3 small-ish files. * Minify 3 external dependencies that do not come minified. * Turn off EXPAND_WEB_DEP_IMPORTS by default. Signed-off-by: Bill Erickson --- diff --git a/Open-ILS/src/templates/staff/base_js.tt2 b/Open-ILS/src/templates/staff/base_js.tt2 index 82b662e432..9c87cbccfe 100644 --- a/Open-ILS/src/templates/staff/base_js.tt2 +++ b/Open-ILS/src/templates/staff/base_js.tt2 @@ -1,9 +1,14 @@ -[% IF EXPAND_WEB_IMPORTS %] + + + + - + +[% IF EXPAND_WEB_DEP_IMPORTS %] + @@ -15,17 +20,18 @@ - + - + +[% ELSE %] - - - - + + +[% END %] - +[% IF EXPAND_WEB_CORE_IMPORTS %] + @@ -45,12 +51,10 @@ - [% ELSE %] - - - + + [% END %]