-
Notifications
You must be signed in to change notification settings - Fork 92
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
Async attribute #52
Comments
I feel there should be an options to overwrite the script tags generate by gulp-usemin, I currently have a case where I have to add a class to my script tag. |
We need async too. Vote for this feature! |
@limonte @woutrbe @klwemu have a look at this https://github.com/futurechan/gulp-asset-transform |
+1 |
2 similar comments
👍 |
+1 |
Just a suggestion - we could have these attributes as an object passed inside the build task, for example : var jsAttributes = {
async : true,
'some-other-attribute' : 'some-value'
};
gulp.task('usemin', function() {
return gulp.src('./*.html')
.pipe(usemin({
css: [ rev() ],
html: [ minifyHtml({ empty: true }) ],
js: [ uglify(), rev() ],
jsAttributes: jsAttributes,
inlinejs: [ uglify() ],
inlinecss: [ minifyCss(), 'concat' ]
}))
.pipe(gulp.dest('build/'));
}); would give you <script src="build.js" async some-other-attribute="some-value"></script> I guess this would solve #75 and #77 as well. Thoughts? |
It would be great to have ability to add async attribute to script tag generated by gulp-usemin.
It's often very useful: https://developers.google.com/web/fundamentals/performance/critical-rendering-path/adding-interactivity-with-javascript#parser-blocking-vs-asynchronous-javascript
The text was updated successfully, but these errors were encountered: