diff --git a/core/mappings.js b/core/mappings.js index 82aa4b6f..faea0709 100644 --- a/core/mappings.js +++ b/core/mappings.js @@ -473,8 +473,7 @@ mappings.cdn = { 'bootstrap-vue@{version}/dist/bootstrap-vue.css': resources.bootstrapVueCSS, 'bootstrap-vue@{version}/dist/bootstrap-vue.min.js': resources.bootstrapVueJS, 'bootstrap-vue@{version}/dist/bootstrap-vue.js': resources.bootstrapVueJS, - 'bowser@{version}/bundled.js' : resources.bowserJS, - 'bowser@{version}/es5.js' : resources.bowserJS, + 'bowser@{version}/': resources.bowserJS, 'bulma@{version}/css/bulma.': resources.bulma, 'chart.js@{version}': resources.chartJs, 'clipboard@{version}/dist/clipboard.': resources.clipboardJS, diff --git a/core/request-analyzer.js b/core/request-analyzer.js index 6c3cf9a5..590fa75d 100644 --- a/core/request-analyzer.js +++ b/core/request-analyzer.js @@ -125,12 +125,19 @@ requestAnalyzer._findLocalTarget = function (resourceMappings, basePath, channel }); resourcePath = channelPath.replace(basePath, ''); - if (Resource.SINGLE_NUMBER_EXPRESSION.test(channelPath)) { - versionNumber = channelPath.match(/\d/); - resourcePattern = resourcePath.replace(versionNumber, Resource.VERSION_PLACEHOLDER); - versionNumber = [`${versionNumber}.0`]; - } else { - versionNumber = resourcePath.match(Resource.VERSION_EXPRESSION); + + // Evaluate first in case of version 'latest' and numerals in resource + versionNumber = resourcePath.match(Resource.VERSION_EXPRESSION); + + // Handle weird version expressions + if(!versionNumber){ + if (Resource.SINGLE_NUMBER_EXPRESSION.test(channelPath)) { + versionNumber = channelPath.match(/\d/); + resourcePattern = resourcePath.replace(versionNumber, Resource.VERSION_PLACEHOLDER); + versionNumber = [`${versionNumber}.0`]; + } + } + else { resourcePattern = resourcePath.replace(versionNumber, Resource.VERSION_PLACEHOLDER); } @@ -142,11 +149,10 @@ requestAnalyzer._findLocalTarget = function (resourceMappings, basePath, channel } return shorthandResource; } - + for (let resourceMold of Object.keys(resourceMappings)) { if (resourcePattern.startsWith(resourceMold)) { let targetPath, versionDelivered, versionRequested, bundle; - targetPath = resourceMappings[resourceMold].path; targetPath = targetPath.replace(Resource.VERSION_PLACEHOLDER, versionNumber); // Replace the requested version with the latest depending on major version diff --git a/core/resources.js b/core/resources.js index e7990b8e..40b1bed9 100644 --- a/core/resources.js +++ b/core/resources.js @@ -253,8 +253,8 @@ var resources = { 'path': 'resources/bootstrap-vue/{version}/bootstrap-vue.min.css' }, // Bowser.js - 'bowserJs': { - 'path': 'resources/bowser/{version}/bundled.min.jsm' + 'bowserJS': { + 'path': 'resources/bowser/{version}/bowser.min.jsm' }, // Bulma 'bulma': { diff --git a/modules/internal/targets.js b/modules/internal/targets.js index 21eb4b5c..47e1a51f 100644 --- a/modules/internal/targets.js +++ b/modules/internal/targets.js @@ -205,9 +205,8 @@ targets.setLastVersion = function (type, version) { return '2.21.2'; } else if (type.startsWith('/bootstrap-3-typeahead/4.')) { return '4.0.2'; - } else if (type.startsWith('/bowser/2.')) { + } else if (type.startsWith('/bowser/')) { return '2.11.0' - } } else if (type.startsWith('/bulma/0.')) { return '0.9.2'; } else if (type.startsWith('/Chart.js/2.')) {