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

New type "remove-block"? #50

Open
lyle-sigurdson opened this issue Aug 6, 2015 · 1 comment
Open

New type "remove-block"? #50

lyle-sigurdson opened this issue Aug 6, 2015 · 1 comment

Comments

@lyle-sigurdson
Copy link

First off, thanks for useref.

I have a situation where I'd like to remove just the build block; that is, remove the link tag loading a CSS file, but allow the CSS file itself to be part of the final build.

What about a new type to add to the existing "js", "css" and "remove" types called "remove-block" that would carry this out?

The situation comes up when loading CSS that's not critical to rendering the above the fold content. The non-critical styles are loaded later by inserting a link tag on the document load event:

<!-- Defer loading 'css/styles.css' which contains styles that aren't       
     critical to rendering above the fold content.                          
-->                                                                         
<!-- build:remove-block -->                                                       
<link href="css/style.css" rel="stylesheet">                                
<!-- endbuild -->                                                           
<script inline src="js/defer-css.js"></script>

I'm using gulp-inline-source to inline the JavaScript.

If not, is this something I could set up myself with a custom block?

Edit: I should have mentioned that I want the link tag there in the first place (even though I'm going to remove it) so I can load the unprocessed files in a browser and have everything there.

@hn3000
Copy link

hn3000 commented Oct 5, 2015

Would it be possible to implement this using a custom block handler?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants