Skip to content

Commit 5ef4dee

Browse files
committed
Read JS concat order directly from Gruntfile
1 parent b5d4805 commit 5ef4dee

2 files changed

Lines changed: 4 additions & 14 deletions

File tree

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
//= require ./bootstrap/util
12
//= require ./bootstrap/alert
23
//= require ./bootstrap/button
34
//= require ./bootstrap/carousel
@@ -6,6 +7,5 @@
67
//= require ./bootstrap/modal
78
//= require ./bootstrap/scrollspy
89
//= require ./bootstrap/tab
9-
//= require ./bootstrap/util
1010
//= require ./bootstrap/tooltip
1111
//= require ./bootstrap/popover

tasks/updater/js.rb

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ class Updater
22
module Js
33
def update_javascript_assets
44
log_status 'Updating javascripts...'
5-
save_to = @save_to[:js]
5+
save_to = @save_to[:js]
66
contents = {}
77
read_files('js/dist', bootstrap_js_files).each do |name, file|
88
contents[name] = file
@@ -29,18 +29,8 @@ def update_javascript_assets
2929

3030
def bootstrap_js_files
3131
@bootstrap_js_files ||= begin
32-
files = get_paths_by_type('js/dist', /\.js$/)
33-
files.sort_by { |f|
34-
case f
35-
# tooltip depends on popover and must be loaded earlier
36-
when /tooltip/ then
37-
1
38-
when /popover/ then
39-
2
40-
else
41-
0
42-
end
43-
}
32+
gruntfile = get_file(file_url 'Gruntfile.js')
33+
JSON.parse(/concat:.*?src: (\[[^\]]+\])/m.match(gruntfile)[1].tr("'", '"')).map { |p| p.sub %r(\Ajs/src/), '' }
4434
end
4535
end
4636
end

0 commit comments

Comments
 (0)