Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/twbs/bootstrap-rubygem.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/tasks
diff options
context:
space:
mode:
authorGleb Mazovetskiy <glex.spb@gmail.com>2015-11-03 11:00:42 +0300
committerGleb Mazovetskiy <glex.spb@gmail.com>2015-11-03 11:00:42 +0300
commit3b0abce46b9f1791a63b08d743805116c4112997 (patch)
tree949a4aa1bf64c428a43b2955a1e0d0fb5dd281a5 /tasks
parentdcac6853355e9cf1df34e5931970565385220610 (diff)
Removes source map comments from JS files #12
Diffstat (limited to 'tasks')
-rw-r--r--tasks/updater/js.rb5
1 files changed, 4 insertions, 1 deletions
diff --git a/tasks/updater/js.rb b/tasks/updater/js.rb
index bfc1c11..9332d21 100644
--- a/tasks/updater/js.rb
+++ b/tasks/updater/js.rb
@@ -5,7 +5,10 @@ class Updater
save_to = @save_to[:js]
contents = {}
read_files('js/dist', bootstrap_js_files).each do |name, file|
- contents[name] = file
+ contents[name] = file.
+ # Remove the source mapping URL comment as this gem does not bundle source maps.
+ sub!(%r(^//# sourceMappingURL=#{name}.map\n\z), '') or
+ fail "Cannot find source mapping URL to remove in #{name}. Last line: #{file.lines.last.inspect}"
save_file("#{save_to}/#{name}", file)
end
log_processed "#{bootstrap_js_files * ' '}"