-
Notifications
You must be signed in to change notification settings - Fork 62
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
README #Usage gulp-useref example outdated #45
Comments
Hi, yes it works for me
2016-01-11 5:46 GMT+01:00 fyrebase [email protected]:
|
@TueCN Example: import * as gulp from 'gulp';
import * as uglify from 'gulp-uglify';
import * as htmlmin from 'gulp-htmlmin';
import * as csso from 'gulp-csso';
import * as gulpif from 'gulp-if';
import * as rev from 'gulp-rev';
import * as useref from 'gulp-useref';
import * as filter from 'gulp-filter';
import revReplace = require('gulp-rev-replace');
import * as debug from 'gulp-debug';
gulp.task('html', () => {
const notIndexFilter = filter(['*', '!index.html'], {restore: true});
return gulp.src('app/index.html')
.pipe(useref({searchPath: ['.tmp', '.']}))
.pipe(debug({title: 'useref:'}))
.pipe(gulpif('*.js', uglify()))
.pipe(gulpif('*.css', csso()))
.pipe(notIndexFilter)
.pipe(rev())
.pipe(notIndexFilter.restore)
.pipe(revReplace())
.pipe(gulpif('*.html', htmlmin({removeComments: true, collapseWhitespace: true})))
.pipe(gulp.dest('dist'))
.pipe(debug({title: 'html:'}));
}); |
@tkrotoff However I was using gulp-filter version 2.0.2 .. Maybe it's time for me to update :) |
Hi.. Thank a lot 👍 |
@TueCN Thanks so much for this 👏 |
Readme looks good now so this can probably be closed. |
Hi
I am trying to upgrade gulp-useref to 3.x.x where they have removed the assets function.
See https://github.com/jonkemp/gulp-useref#migration-from-v2-api
I am trying to maintain a pipeline with gulp-filter, gulp-useref, gulp-rev, and gulp-rev-replace like in your Usage example, but I am not quite sure how to proceed without the assets function.
Can anyone help suggest how to make these plugins work together and in the process we can hopefully get the README updated.
Proposed fix:
I ended up with the following - a bit clumsy - but it works!
If anyone can simplify it please be my guest.
Also - I also show how to generate source maps
The text was updated successfully, but these errors were encountered: