A quick script to inline / inject a source map file into the JavaScript source file.
Use case: Sometimes you have a script.js and a script.js.map file, and you'd prefer to inline the source map as a data URI directly into the script.js file.
NOTE: Modifies the script.js file in-place
inline_source_map.rb <script.js>
- script.js must end with
//# sourceMappingURL=some.js.map
- Modifies script.js in-place, injecting the base-64 encoded data URI in place of the some.js.map reference