UNPKG

@ant-design/tools

Version:
24 lines 474 B
import urlLoader from 'url-loader'; import getWebpackConfig from "../getWebpackConfig"; const { svgRegex, svgOptions, imageOptions } = getWebpackConfig; function process(src, filename) { const instance = { resourcePath: filename }; if (svgRegex.test(filename)) { instance.query = svgOptions; } else { instance.query = imageOptions; } const result = urlLoader.call(instance, src); return { code: result }; } export default { process };