Files
2019-01-24 18:43:48 +03:00

7 lines
289 B
JavaScript

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