Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add support for link preload hrefs #142

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion lib/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,12 @@ function generate(opts) {
}

// Oust extracts a list of your stylesheets
var stylesheets = oust(html.toString(), 'stylesheets').map(file.resourcePath(opts));
var stylesheets = [
oust(html.toString(), 'stylesheets'),
oust(html.toString(), 'preload')
].reduce(function (a, b) {
return a.concat(b);
}, []).map(file.resourcePath(opts));
debug('Stylesheets: ' + stylesheets);
return Promise.map(stylesheets, file.assertLocal(opts));
// read files
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
"meow": "^3.3.0",
"mime-types": "^2.1.6",
"object-assign": "^4.0.1",
"oust": "^0.2.3",
"oust": "git://github.com/akrawchyk/oust",
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you reset this? oust 0.3.0 is now out with the PR you submitted.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So I'm wondering if #129 is a better idea. I'm pleased oust supports preload links, but I noticed inline-critical automates the preload pattern.

This still might be useful, however, if there are manually added preload links in the HTML that critical will parse. Perhaps both PR's make sense?

"parseurl": "^1.3.0",
"penthouse": "^0.9.2",
"postcss": "^5.0.5",
Expand Down