Open ocombe opened 9 years ago
Oh and I just checked, it's really long with minified js as well
Can you show me how you're calling the function exactly/
I don't have the code here (I'm at home), but I think it's something like that (writing this from memory):
var input = fs.readFileSync(file.path, 'utf-8');
var cb = require("cache-breaker");
var match = ['.png|.jpg|.jpeg|.gif|.js|.css|.htm|.html'];
var options = {
match: match,
replacement: 'md5',
src: input
};
var broken = cb.breakCache(input, match, options);
Hey @shakyShane did you get a chance to look at this ?
Hi, I was writing the gulp plugin for this lib, and came onto this problem: the replace function is really really really slow on minified css (like 10mn), when the same unminified css is almost immediate. I have no idea why, but the problem is in the line
return src.replace(regex, replacer);
Here is a sample minified css:
And the replace regex that I'm using:
'.png|.jpg|.jpeg|.gif|.js|.css|.htm|.html'