Created
November 19, 2014 10:02
-
-
Save tangzhen/e15bcbd3ca8af56b2ba3 to your computer and use it in GitHub Desktop.
Add additional options into concat&uglify when use usemin
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'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