removeSourceMappingUrl.js 628 B

12345678910111213141516171819
  1. 'use strict';
  2. var matchSourceMappingUrl = /\/\*# sourceMappingURL=[^*]+\*\//;
  3. /**
  4. * Removes the sourceMappingURL comment. This is necessary because the less-loader
  5. * does not know where the final source map will be located. Thus, we remove every
  6. * reference to source maps. In a regular setup, the css-loader will embed the
  7. * source maps into the CommonJS module and the style-loader will translate it into
  8. * base64 blob urls.
  9. *
  10. * @param {string} content
  11. * @returns {string}
  12. */
  13. function removeSourceMappingUrl(content) {
  14. return content.replace(matchSourceMappingUrl, '');
  15. }
  16. module.exports = removeSourceMappingUrl;