Optimise Web via treeshaking, cleanup build scripts

This commit is contained in:
Vendicated
2022-10-16 17:15:15 +02:00
parent 845088ec02
commit 01ae0983b3
14 changed files with 261 additions and 269 deletions

View File

@ -28,12 +28,15 @@ export default definePlugin({
find: "Messages.ACTIVITY_SETTINGS",
replacement: {
match: /\{section:(.{1,2})\.ID\.HEADER,\s*label:(.{1,2})\..{1,2}\.Messages\.ACTIVITY_SETTINGS\}/,
replace: (m, mod) =>
`{section:${mod}.ID.HEADER,label:"Vencord"},` +
'{section:"VencordSetting",label:"Vencord",element:Vencord.Components.Settings},' +
'{section:"VencordUpdater",label:"Updater",element:Vencord.Components.Updater,predicate:()=>!IS_WEB},' +
`{section:${mod}.ID.DIVIDER},${m}`
replace: (m, mod) => {
const updater = !IS_WEB ? '{section:"VencordUpdater",label:"Updater",element:Vencord.Components.Updater},' : "";
return (
`{section:${mod}.ID.HEADER,label:"Vencord"},` +
'{section:"VencordSetting",label:"Vencord",element:Vencord.Components.Settings},' +
updater +
`{section:${mod}.ID.DIVIDER},${m}`
);
}
}
}]
});