File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 22
33class Updater
44 module Js
5+ INLINED_SRCS = %w[ base-component.js util/index.js util/sanitizer.js ] . freeze
6+
57 def update_javascript_assets
68 log_status 'Updating javascripts...'
79 save_to = @save_to [ :js ]
@@ -29,13 +31,13 @@ def update_javascript_assets
2931
3032 def bootstrap_js_files
3133 @bootstrap_js_files ||= begin
32- src_files = get_paths_by_type ( 'js/src' , /\. js$/ ) - %w[ util/index.js util/sanitizer.js ]
34+ src_files = get_paths_by_type ( 'js/src' , /\. js$/ ) - INLINED_SRCS
35+ puts "src_files: #{ src_files . inspect } "
3336 imports = Deps . new
3437 # Get the imports from the ES6 files to order requires correctly.
3538 read_files ( 'js/src' , src_files ) . each do |name , content |
36- imports . add name ,
37- *content . scan ( %r{import [a-zA-Z]* from '\. /([\w /-]+)} )
38- . flatten ( 1 ) . map { |f | "#{ f } .js" } . uniq
39+ file_imports = content . scan ( %r{import *(?:[a-zA-Z]*|\{ [a-zA-Z ,]*\} ) *from '\. /([\w /-]+)} ) . flatten ( 1 ) . map { |f | "#{ f } .js" } . uniq
40+ imports . add name , *( file_imports - INLINED_SRCS )
3941 end
4042 imports . tsort
4143 end
You can’t perform that action at this time.
0 commit comments