1234567891011121314151617181920212223 |
- 'use strict';
- const shouldAddResourceHints = options => {
- return !(options.prefetch.test.length === 0 &&
- options.preload.test.length === 0);
- };
- const createResourceHint = (rel, href) => {
- return {
- tagName: 'link',
- selfClosingTag: true,
- attributes: {
- rel: rel,
- href: href,
- as: 'script'
- }
- };
- };
- module.exports = {
- shouldAddResourceHints,
- createResourceHint
- };
|