UNPKG

@arco-plugins/webpack-react

Version:
18 lines (17 loc) 733 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var loader_utils_1 = require("loader-utils"); // 替换Arco默认图标 var ReplaceIconLoader = function (content) { var _a = (0, loader_utils_1.getOptions)(this), iconBoxLib = _a.iconBoxLib, iconBoxDirname = _a.iconBoxDirname; if (!iconBoxLib) { return content; } var matches = this.resourcePath.match(/@arco-design\/web-react\/icon\/react-icon\/([^/]+)\/index\.js$/); if (matches && iconBoxLib[matches[1]]) { return "export {default} from '".concat(iconBoxDirname, "/esm/").concat(matches[1], "/index.js';"); } return content; }; module.exports = ReplaceIconLoader; module.exports.default = ReplaceIconLoader;