File tree Expand file tree Collapse file tree 1 file changed +3
-11
lines changed Expand file tree Collapse file tree 1 file changed +3
-11
lines changed Original file line number Diff line number Diff line change @@ -33,24 +33,16 @@ def map_dependencies
33
33
basename = File . basename path
34
34
file = File . read path
35
35
36
- matchdata = file . match ( /define\( . *\[ [ \S \s ]+ \] \, factory \) ; /m )
36
+ matchdata = file . match ( /define\( \s *\[ \s *([ \" \. \/ \, \w \s - \: ]+) \] /m )
37
37
38
- # fallback for core.js, which doesn't refer to factory
39
- matchdata ||= file . match ( /define\( .*\[ [\S \s ]+\] (\, factory )?.*\) ;/m )
40
-
41
- # skip if there's no dependencies
42
38
next if matchdata . nil?
43
39
44
- # dirty string, with define([], factory) wrapping, comments and newlines
45
- deps_str = matchdata [ 0 ]
46
-
47
- # remove define([], factory) wrap
48
- deps = deps_str . match ( /\[ [\s \S ]*\] / ) [ 0 ]
40
+ deps = matchdata [ 1 ]
49
41
50
42
# remove lines with comments
51
43
deps = deps . gsub ( /\/ \/ .+\s / , "" )
52
44
53
- # remove all non-path symbols, leaving only commas, dots and shashes
45
+ # remove all non-path symbols
54
46
deps = deps . gsub ( /[\r \n \t \" \[ \] \s ]/ , "" )
55
47
56
48
deps_paths = deps . split ( ',' )
You can’t perform that action at this time.
0 commit comments