This repository was archived by the owner on Mar 23, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +18
-13
lines changed Expand file tree Collapse file tree 1 file changed +18
-13
lines changed Original file line number Diff line number Diff line change 1- //Load the requirejs optimizer
2- var requirejs = require ( '<%= rjs_path %>' ) ,
3- //Set up basic config, include config that is
4- //common to all the optimize() calls.
5- baseConfig = < %=
6- modifiedHash = build_config . select { | k , _ | k ! = "modules" }
7- pathsHash = modifiedHash [ "paths" ]
8- modifiedHash [ "dir" ] = build_dir . to_s
9- modifiedHash [ "paths" ] = pathsHash . select { | _ , v | ! v . is_a ?( Array ) } if ! pathsHash . nil ?
1+ var requirejs = require ( < %= rjs_path . to_s . dump % > )
2+ var baseConfig = < %=
3+ cdn_pattern = Regexp . new ( "\\Ahttps?://" )
104
11- JSON . pretty_generate ( modifiedHash )
12- % > ;
5+ modifiedHash = build_config . select { | k , _ | k != "modules" }
6+ pathsHash = modifiedHash [ "paths" ]
7+ modifiedHash [ "dir" ] = build_dir . to_s
8+ modifiedHash [ "paths" ] = Hash [ pathsHash
9+ . select do | _ , v |
10+ ! v . is_a ?( Array )
11+ end . map do | k , v |
12+ [ k , if ! cdn_pattern . match ( v ) then v else "empty:" end ]
13+ end
14+ ] if ! pathsHash . nil ?
15+
16+ JSON . pretty_generate ( modifiedHash )
17+ % > ;
1318
1419baseConfig . modules = [
15- < % build_config [ ' modules' ] . each do | m | % >
16- < %= JSON . pretty_generate ( m ) % > ,
20+ < % build_config [ " modules" ] . each do | m | % >
21+ < %= JSON . pretty_generate ( m ) % > ,
1722< % end % >
1823] ;
1924
You can’t perform that action at this time.
0 commit comments