Improved: Font Awesome (Fonts only) (#170)
This commit is contained in:
parent
c47b926d30
commit
7edb451d17
|
@ -203,7 +203,7 @@ const Regex = {
|
||||||
'BOOTSTRAP_DATEPICKER': /\/bootstrap-datepicker.*\.css/,
|
'BOOTSTRAP_DATEPICKER': /\/bootstrap-datepicker.*\.css/,
|
||||||
'FONT_AWESOME': /use\.fontawesome\.com\/fa-loader\.css/,
|
'FONT_AWESOME': /use\.fontawesome\.com\/fa-loader\.css/,
|
||||||
'FONT_AWESOME_WITH_CODE': /use\.fontawesome\.com\/[a-z0-9]{10}\.(js|css)/,
|
'FONT_AWESOME_WITH_CODE': /use\.fontawesome\.com\/[a-z0-9]{10}\.(js|css)/,
|
||||||
'FONT_AWESOME_ONLY_FONTS': /\/font-awesome\/(?:\d{1,2}\.){1,3}\d{1,2}\/fonts\//
|
'FONT_AWESOME_FONTS_ONLY': /\/fontawesome\/(?:\d{1,2}\.){1,3}\d{1,2}\/fonts\//
|
||||||
};
|
};
|
||||||
|
|
||||||
const Links = {
|
const Links = {
|
||||||
|
|
|
@ -817,7 +817,8 @@ mappings.cdn = {
|
||||||
'bootstrap/{version}/js/bootstrap.min.': resources.bootstrapJS,
|
'bootstrap/{version}/js/bootstrap.min.': resources.bootstrapJS,
|
||||||
'bootstrap/{version}/css/bootstrap.min.': resources.bootstrapCSS,
|
'bootstrap/{version}/css/bootstrap.min.': resources.bootstrapCSS,
|
||||||
'twitter-bootstrap/{version}/css/bootstrap': resources.bootstrapCSS,
|
'twitter-bootstrap/{version}/css/bootstrap': resources.bootstrapCSS,
|
||||||
'font-awesome/{version}/css/font-awesome': resources.fontawesome
|
'font-awesome/{version}/css/font-awesome': resources.fontawesome,
|
||||||
|
'font-awesome/{version}/fonts/': resources.fontawesomeFontsOnly
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
// NetDNA Bootstrap
|
// NetDNA Bootstrap
|
||||||
|
|
|
@ -158,7 +158,7 @@ requestAnalyzer._findLocalTarget = function (resourceMappings, basePath, channel
|
||||||
let bundle = targets.determineBundle(targetPath);
|
let bundle = targets.determineBundle(targetPath);
|
||||||
if (bundle !== '') {
|
if (bundle !== '') {
|
||||||
filename = channelPath.split('/').pop();
|
filename = channelPath.split('/').pop();
|
||||||
targetPath = ( RegExp('.*\.css$').test(filename) ) ? targetPath + filename : targetPath + filename + 'm';
|
targetPath = ( filename.endsWith('.js') ) ? targetPath + filename + 'm' : targetPath + filename;
|
||||||
targetPath = helpers.formatFilename(targetPath);
|
targetPath = helpers.formatFilename(targetPath);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -381,6 +381,9 @@ var resources = {
|
||||||
'path': 'resources/fontawesome/{version}/js/all.min.jsm',
|
'path': 'resources/fontawesome/{version}/js/all.min.jsm',
|
||||||
'type': 'application/javascript'
|
'type': 'application/javascript'
|
||||||
},
|
},
|
||||||
|
'fontawesomeFontsOnly': {
|
||||||
|
'path': 'resources/fontawesome/{version}/fonts/'
|
||||||
|
},
|
||||||
// GSAP
|
// GSAP
|
||||||
'gsapBundle': {
|
'gsapBundle': {
|
||||||
'path': 'resources/gsap/{version}/',
|
'path': 'resources/gsap/{version}/',
|
||||||
|
|
|
@ -165,14 +165,6 @@ shorthands.specialFiles = function (channelHost, channelPath, searchString) {
|
||||||
'path': 'resources/google-charts/loader.jsm',
|
'path': 'resources/google-charts/loader.jsm',
|
||||||
'bundle': ''
|
'bundle': ''
|
||||||
};
|
};
|
||||||
} else if (Regex.FONT_AWESOME_ONLY_FONTS.test(channelPath)) {
|
|
||||||
lastVersion = targets.setLastVersion('/fontawesome/4.');
|
|
||||||
return {
|
|
||||||
'source': channelHost,
|
|
||||||
'versionDelivered': lastVersion,
|
|
||||||
'path': 'resources/fontawesome/' + lastVersion + '/fonts/' + helpers.extractFilenameFromPath(channelPath),
|
|
||||||
'bundle': 'Font Awesome (Fonts)'
|
|
||||||
};
|
|
||||||
} else {
|
} else {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -42,6 +42,8 @@ targets.determineBundle = function (path) {
|
||||||
return 'Select2';
|
return 'Select2';
|
||||||
} else if (path.startsWith('/gsap/')) {
|
} else if (path.startsWith('/gsap/')) {
|
||||||
return 'GSAP';
|
return 'GSAP';
|
||||||
|
} else if (Regex.FONT_AWESOME_FONTS_ONLY.test(path)) {
|
||||||
|
return 'Font Awesome (Fonts)';
|
||||||
} else {
|
} else {
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue