From cbf0c058c0175f74557baf49e64ce6772cddff3f Mon Sep 17 00:00:00 2001 From: nobody Date: Tue, 28 Dec 2021 08:09:11 +0100 Subject: [PATCH] Detection of Vue.js v2 and v3 improved (#825) --- core/shorthands.js | 19 ++++++++++++++++--- pages/updates/updates.html | 1 + 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/core/shorthands.js b/core/shorthands.js index 2b13675b..0db115c8 100644 --- a/core/shorthands.js +++ b/core/shorthands.js @@ -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, diff --git a/pages/updates/updates.html b/pages/updates/updates.html index c9b68649..ba10679a 100644 --- a/pages/updates/updates.html +++ b/pages/updates/updates.html @@ -38,6 +38,7 @@