Comments (7)
Hi,
yes it works for me
.pipe(notIndexFilter)
.pipe(rev()) // Rename the concatenated files
.pipe(notIndexFilter.restore())
.pipe(revReplace()) // Substitute in new filenames
.pipe(gulp.dest('public'));
2016-01-11 5:46 GMT+01:00 fyrebase [email protected]:
Hey @TueCN https://github.com/TueCN did this solution end up working
for you? gulp-rev-replace is revving the index.html file for me and not any
of the the actual revved files inside index.html—
Reply to this email directly or view it on GitHub
#45 (comment)
.
from gulp-rev-replace.
@TueCN
jsFilter.restore()
should be written jsFilter.restore
=> see gulp-filter documentation
You also need to pass option restore: true
.
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:'}));
});
from gulp-rev-replace.
@tkrotoff
Yes you are right if you are using gulp-filter version 3.x
However I was using gulp-filter version 2.0.2
https://github.com/sindresorhus/gulp-filter/tree/v2.0.2#simple
.. Maybe it's time for me to update :)
from gulp-rev-replace.
Hi..
it works for me as well..
Thank a lot 👍
from gulp-rev-replace.
@TueCN Thanks so much for this 👏
from gulp-rev-replace.
Readme looks good now so this can probably be closed.
from gulp-rev-replace.
I'm using your example, as well as referencing yeoman, and I'm having an issue with the file names not being replaced in my html file - #70. I'm using gulp-filters v4.0 if that maybe makes a difference, as well as gulp-useref v3.1.
UPDATE
nvm figured it out.
from gulp-rev-replace.
Related Issues (20)
- Index replacements fail to occur when using gulp-filter HOT 1
- is it me, or this doesn't work with gulp-filter? HOT 1
- Can only be replaced once ?
- Not working on php files ? HOT 1
- Replacing CSS and JS references in PHP files with this 'assets' task?
- working with html.twig (php templates) file HOT 1
- Confused as to the usage of this plugin in regards to new filepaths
- Question: How to use gulp-rev & gulp-rev-replace with custom src that does not match file name
- could i use gulp-rev setting the url in the rev-manifest.json
- fail to work with [email protected] HOT 2
- Html Output Doesn't Contain Replaced Names If Using $.rev.manifest() HOT 2
- Not making replacements in src files without replaceInExtensions
- options.replaceInExtensions HOT 12
- No replace in json files HOT 4
- should provide the file information to `modifyUnreved/modifyReved` method?
- replacing same reference more then one times HOT 1
- the plugin can't replace requirejs path in php file HOT 2
- Can't replace URI-encoded file name including non-ascii characters HOT 1
- Replace deprecated dependency gulp-util
- .woff2 references inside css not renaming correctly HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gulp-rev-replace.