mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
ui: upgrade to webpack5
This commit is contained in:
1 parent
8648929063
commit
a05125c6b0
134 files changed
+503
-457
No files matched your search
@@ -1,18 +0,0 @@
|
||||
/* eslint-disable import/no-extraneous-dependencies */
|
||||
import { escapeRegExp } from 'lodash';
|
||||
|
||||
export default function mapWebpackUrlPrefix(mapList) {
|
||||
const rules = mapList.map((mappingRule) => {
|
||||
const regex = mappingRule.prefix.split('/').map((s) => escapeRegExp(s)).join('[\\/\\\\]');
|
||||
return {
|
||||
from: new RegExp(`^${regex}`, mappingRule.flag),
|
||||
to: mappingRule.replace,
|
||||
};
|
||||
});
|
||||
return function mapUrl(url) {
|
||||
rules.forEach((rule) => {
|
||||
url = url.replace(rule.from, rule.to);
|
||||
});
|
||||
return url;
|
||||
};
|
||||
}
|
||||
Reference in new issue
Block a user