Skip to content

Instantly share code, notes, and snippets.

@tangzhen
Created November 19, 2014 10:02
Show Gist options
  • Save tangzhen/e15bcbd3ca8af56b2ba3 to your computer and use it in GitHub Desktop.
Save tangzhen/e15bcbd3ca8af56b2ba3 to your computer and use it in GitHub Desktop.
Add additional options into concat&uglify when use usemin
'use strict';
module.exports = {
html: '<%= config.web %>/index.html',
options: {
dest: '<%= config.dist %>',
flow: {
html: {
steps: {
js: ['concat', 'uglifyjs']
},
post: {
js: [
{
name: 'concat',
createConfig: function (context, block) {
var generated = context.options.generated;
generated.options = {
sourceMap: true
};
}
},
{
name: 'uglify',
createConfig: function (context, block) {
var generated = context.options.generated;
generated.options = {
sourceMap: true,
sourceMapIncludeSources : true,
sourceMapIn : function (file) {
return file + '.map';
}
};
}
}
]
}
}
}
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment