-
Notifications
You must be signed in to change notification settings - Fork 339
Ability to replace revved urls inside of js files #5
Comments
I made an angular processor here, if you're interested in a pull request, let me know and I'll put it together. Angular Processor: https://gist.github.com/4289095 |
I like the idea of being able to register an additional matcher ... Going to have a look at this, as soon as yeoman is stabilised. |
I know @btford did some similar replacing stuff in the Angular generator. What do you think? |
Any idea where that work lives? What about adding in an option to usemin so that if you pass an object instead of a string, you can specify a pattern to match, so something like:
js: {
pattern: /templateUrl:.?['"]([^"']+)["']/gm,
path: '<%= yeoman.app %>/js/*.js'
}
|
I've made https://github.com/btford/grunt-google-cdn and https://github.com/btford/ngmin, but neither of those really are designed to address this issue. I'd say adding this to usemin, or making this into a new Grunt task would be the way to go. |
A workaround for the time being regarding images is to, instead of having the path hardcoded in JS, put it in your HTML and the fetch it with JS. That way it will be correctly rev it. With images it would probably be better to place it in the CSS anyway. |
That's a bit of a mess of a workaround and while CSS is quite often the right place there are times when it isn't. Also running into places where an angular property (that isn't a standard tag) references an image and has the same problem. I'd be happy to add a custom matcher our enable some greedy match mode but as it stands it's a bit of a pain to work with. Any other suggestions? |
V2.0 supports user defined matchers. |
Hi guys, same problem here. Any updates on when 2.0 will be available from npm? |
+1 to Usemin-ing references in the JS. It's often more proper to use a content image than a CSS background. |
I also would really like to see this feature. What am I supposed to do if I'm working in canvas or SVG and want to load an image? I figured a lot of people would have that problem, am I missing something? Fetching filenames from HTML or CSS seems super hacky in that case... |
I'd like this feature as well. |
+1 for this feature. I am having this issue working on a project where we are dynamically building an SVG chart and setting the image paths in the JS. |
+1 please |
This is too fragile to have in core, but define your own blocks: #337 |
I would like to rev my templates that I use with angular, and they get referenced in my module declaration in angular, with a path of something like this:
$routeProvider.when('/dashboard', { templateUrl: 'templates/dashboard.html', controller: etv.DashboardCtrl });
I'm revving them up, but need to have them replaced in that one file. Is there any way to register an additional 'matcher' to have these replaced, or do I just need to fork the task to add that?
The text was updated successfully, but these errors were encountered: