Skip to content
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

File replacement not correct #13

Closed
manohartn opened this issue Jul 24, 2015 · 7 comments
Closed

File replacement not correct #13

manohartn opened this issue Jul 24, 2015 · 7 comments

Comments

@manohartn
Copy link

Suppose i have two files :

  1. abc/def/xyz.js
  2. ghi/klm/xyz.js
    (Notice there are two different files (but of same file names - xyz.js) in two different paths and if i have both the files included in my jsp, both the files are replaced with same hashed version although they two hash to two different hash
@srathbun
Copy link

I've run into the same issue.

@techjacker
Copy link
Owner

Version 1.0.0 fixed a lot of these issues. Are you still experiencing with a 1+ version?

@danielaromeo
Copy link

danielaromeo commented Aug 30, 2016

Hi, I had the same issue, so I updated to latest version and now I get the following error:

Object javascript/uploaderJs/ has no method 'startsWith'

Here is my code:
`grunt.registerTask('version-assets', 'version the static assets just created', function() {

var Version = require("node-version-assets");
var versionInstance = new Version({
    assets: ['work/myfolder/javascript/main.js', 'work/myfolder/javascript/ppAjax.js','work/myfolder/javascript/uploaderJs/uploader.js],
    grepFiles: ['work/**/*.php']
});

var cb = this.async(); // grunt async callback
versionInstance.run(cb);

});
`
Could it be related to the latest version or is there something wrong in my configuration? Before upgrading it was working, but it was replacing strings on a file ppuploader.js (it used uploader.js versioned string), which I do not want to be versioned.

@techjacker
Copy link
Owner

Could you add a test case with your situation? Then I can try to debug it.

@danielaromeo
Copy link

danielaromeo commented Aug 30, 2016

Hi, I have been able to fix the issue. It seems that the function "startsWith" is not supported by all browsers. Now, I'm not running the script in a browser, but from my Linux shell, so I think that that function doesn't exists somewhere on my system. So I replaced it with "indexOf" and now everything is working well. I attach the modified file, if you want to look at it.

replace_text.zip

@techjacker
Copy link
Owner

This package is for node.js only. It's not designed to be run in a browser.

@danielaromeo
Copy link

I said I'm not running it from a browser, but from my Linux shell, so I suppose that there's something missing on my machine then.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants