Giter VIP home page Giter VIP logo

Comments (12)

weilinzung avatar weilinzung commented on September 25, 2024

???

from gulp-rev-replace.

auban avatar auban commented on September 25, 2024

Same problem

from gulp-rev-replace.

TheDancingCode avatar TheDancingCode commented on September 25, 2024

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.

weilinzung avatar weilinzung commented on September 25, 2024

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.csshas 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.

TheDancingCode avatar TheDancingCode commented on September 25, 2024

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.

weilinzung avatar weilinzung commented on September 25, 2024

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.

#74

thanks!

from gulp-rev-replace.

TheDancingCode avatar TheDancingCode commented on September 25, 2024

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.

weilinzung avatar weilinzung commented on September 25, 2024

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.

TheDancingCode avatar TheDancingCode commented on September 25, 2024

Have you tried using a rev-manifest.json file as described here?

from gulp-rev-replace.

weilinzung avatar weilinzung commented on September 25, 2024

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.

 avatar commented on September 25, 2024

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.

TheDancingCode avatar TheDancingCode commented on September 25, 2024

@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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.