1
0
mirror of https://codeberg.org/nobody/LocalCDN.git synced 2025-06-05 21:49:31 +02:00

Detection of Vue.js v2 and v3 improved (#825)

This commit is contained in:
nobody
2021-12-28 08:09:11 +01:00
parent 2c4629d87a
commit cbf0c058c0
2 changed files with 17 additions and 3 deletions

View File

@@ -201,9 +201,22 @@ shorthands.specialFiles = function (channelHost, channelPath, searchString) {
'path': `resources/materialize/1.0.0/${channelPath}`,
'bundle': 'Materialize'
};
} else if ((/cdn\.jsdelivr\.net\/npm\/vue@(2|3)/).test(CompleteURL)) {
let version = CompleteURL.match(Resource.VERSION_EXPRESSION);
lastVersion = targets.setLastVersion(`/vue/${version}.`);
} else if (CompleteURL === 'cdn.jsdelivr.net/npm/vue@2') {
lastVersion = targets.setLastVersion('/vue/2.');
if (lastVersion === '') {
return {
'result': false,
};
}
return {
'source': channelHost,
'versionDelivered': lastVersion,
'versionRequested': lastVersion,
'path': `resources/vue/${lastVersion}/vue.min.jsm`,
'bundle': ''
};
} else if (CompleteURL === 'cdn.jsdelivr.net/npm/vue@3') {
lastVersion = targets.setLastVersion('/vue/3.');
if (lastVersion === '') {
return {
'result': false,