diff options
author | Gleb Mazovetskiy <glex.spb@gmail.com> | 2015-11-03 11:00:42 +0300 |
---|---|---|
committer | Gleb Mazovetskiy <glex.spb@gmail.com> | 2015-11-03 11:00:42 +0300 |
commit | 3b0abce46b9f1791a63b08d743805116c4112997 (patch) | |
tree | 949a4aa1bf64c428a43b2955a1e0d0fb5dd281a5 | |
parent | dcac6853355e9cf1df34e5931970565385220610 (diff) |
Removes source map comments from JS files #12
-rw-r--r-- | tasks/updater/js.rb | 5 |
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 * ' '}" |