-
Notifications
You must be signed in to change notification settings - Fork 106
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
Add usemin option #63
Comments
@ericclemmons I'm getting the following error now:
|
@ericclemmons nevermind, that was due to a leftover |
@ericclemmons Not getting any errors now, but it doesn't seem like it's actually getting concatenated to application.js |
@pheuter I assume @ericclemmons have to fix this issue first to make it work :) |
I'm confused about the status of this issue. It appears that @ericclemmons fixed something in #44 which should have fixed @pheuter's use case. @pheuter - are you saying that it doesn't? |
I attempted to fix it in #44, but there was another edge case to be resolved here ;) The good news is, this will be BC-compatible with 0.4.x |
I'm currently trying to set it up using v0.5.0 and I'm getting |
Wait, everyone just wait! :) Go to #63 now. |
tl;dr If you just create a sigle js file with usemin use @szimek You have to use ngtemplates: {
dist: {
cwd: '<%= yeoman.app %>',
src: 'views/**.html',
dest: '<%= yeoman.dist %>/scripts/templates.js',
options: {
module: 'app', // Can replace ngtemplates.dist with ngtemplates.app
concat: 'generated',
// htmlmin: { collapseWhitespace: true, collapseBooleanAttributes: true },
htmlmin: {}
}
}
}, But this will concat templates for all js groups. |
@marcalj Thanks, but unfortunately I've got 2 js groups... Also I've just noticed that I've got |
Yep, let's wait for this issue to get fixed, then. Everyone be sure to thank grunt-usemin for changing how it builds concat targets now! |
Here's a small snippet that adds if (options.usemin) {
var _ = grunt.util._;
var config = grunt.config('concat');
var prefix = '.tmp/concat/';
var files = _.find(config.generated.files, function (item) {
return item.dest === prefix + options.usemin;
});
files.src.push(file.dest);
grunt.config('concat', {
generated: { files: config.generated.files }
});
} It doesn't handle errors (i.e. invalid path to destination file in concat configuration) and I'm not sure how to read Here's commit with these changes: szimek@1235cd4 |
Just released |
@ericclemmons Thanks Eric! Much appreciated. 👍 |
@ericclemmons Works perfectly! Excellent job! :) |
I'll leave this here in case someone is looking into how make |
From @pheuter:
In which case, the jump to
0.5.0
may not be warranted (whoops!), because this solution can let someone specifyusemin: 'javascripts/application.js'
to target that specificdest
.concat
is useful if you have a specific concat task, but trying to target what usemin generates forconcat
is annoying at best.The text was updated successfully, but these errors were encountered: