Comments (12)
???
from gulp-rev-replace.
Same problem
from gulp-rev-replace.
I tried reproducing weilinzung's case, but replacement in JSON files works just fine here. Could you provide the gulp task you're using, and your rev-manifest.json
?
from gulp-rev-replace.
It is actual only export with revision name manifest-128fcfa762.json
, but the image path inside of the .json
& .xml
would not change. If the xxx.js
& xxx.css
has image path, it would actual changed and everything works fine.
Current Result:
manifest-128fcfa762.json
{
"name": "App",
"icons": [
{
"src": "\/android-icon-36x36.png",
"sizes": "36x36",
"type": "image\/png",
"density": "0.75"
},
{
"src": "\/android-icon-48x48.png",
"sizes": "48x48",
"type": "image\/png",
"density": "1.0"
},
{
"src": "\/android-icon-72x72.png",
"sizes": "72x72",
"type": "image\/png",
"density": "1.5"
},
{
"src": "\/android-icon-96x96.png",
"sizes": "96x96",
"type": "image\/png",
"density": "2.0"
},
{
"src": "\/android-icon-144x144.png",
"sizes": "144x144",
"type": "image\/png",
"density": "3.0"
},
{
"src": "\/android-icon-192x192.png",
"sizes": "192x192",
"type": "image\/png",
"density": "4.0"
}
]
}
browserconfig-653d077300.xml
<?xml version="1.0" encoding="utf-8"?>
<browserconfig>
<msapplication>
<tile>
<square70x70logo src="/ms-icon-70x70.png"/>
<square150x150logo src="/ms-icon-150x150.png"/>
<square310x310logo src="/ms-icon-310x310.png"/>
<TileColor>#ffffff</TileColor></tile>
</msapplication>
</browserconfig>
Expected Result:
manifest-b58fcfa762.json
{
"name": "App",
"icons": [
{
"src": "\/android-icon-36x36-sd5sdffa12.png",
"sizes": "36x36",
"type": "image\/png",
"density": "0.75"
},
...
]
}
browserconfig-653d077300.xml
<?xml version="1.0" encoding="utf-8"?>
<browserconfig>
<msapplication>
<tile>
<square70x70logo src="/ms-icon-70x70-xd5sdffa12.png"/>
...
<TileColor>#ffffff</TileColor></tile>
</msapplication>
</browserconfig>
from gulp-rev-replace.
Yes, but can you show the gulp task that you're using? It's hard to guess what you're doing wrong otherwise.
from gulp-rev-replace.
sure.
var gulp = require('gulp');
var rev = require('gulp-rev');
var revReplace = require('gulp-rev-replace');
gulp.task("index", function() {
return gulp.src(['_site/**/*.jpg','_site/**/*.png','_site/**/*.json','_site/**/*.js','_site/**/*.css','_site/**/*.xml'])
.pipe(rev())
.pipe(revReplace({
replaceInExtensions: ['.js', '.css', '.html', '.hbs', '.json','.xml']
}))
.pipe(gulp.dest('_site'));
});
The default options.replaceInExtensions
doesn't have .json
& .xml
, so I don't think it is supported and that is why I am asking to add those.
thanks!
from gulp-rev-replace.
The list of globs that you pass to gulp.src
should be an array, like this:
gulp.src(['_site/**/*.jpg','_site/**/*.png','_site/**/*.json','_site/**/*.js','_site/**/*.css','_site/**/*.xml'])
from gulp-rev-replace.
I don't think that could make the .json & .xml
works... It is about this plugin feature...
I try what you said, nothing really happens.
from gulp-rev-replace.
Have you tried using a rev-manifest.json
file as described here?
from gulp-rev-replace.
Yes. not working~
That idea is just to create a new reference JSON, doesn't change the value inside of the existing .json
or .xml
files.
I think you don't understand this issue is gulp-rev-replace
that doesn't support .json & .xml
extensions. Right now, only re-reference the file name but not re-reference the new filenames inside of .json & .xml
.
from gulp-rev-replace.
The problem is the list of FRONT_DELIMITERS
and BACK_DELIMITERS
in lib/replace.js
addition of a <
and a >
allows it to work for XML files as well.
from gulp-rev-replace.
@akixi-johnathonclark
Do you have examples of common xml lines in which a filename appears just after <
or before >
?
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
- 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.