blobUrl.js 289 B

123456
  1. const loaderUtils = require('loader-utils');
  2. module.exports = function blobUrl(source) {
  3. const { type } = loaderUtils.getOptions(this) || {};
  4. return `module.exports = URL.createObjectURL(new Blob([${JSON.stringify(source)}]${type ? `, { type: ${JSON.stringify(type)} }` : ''}));`;
  5. };