Update inject-dependencies.js

fixed regex
\s finds all whitespace characters, including newlines which results in finding the spaces of the last line also.