javascript - How to remove JS logging calls in our prod build of our mvc3 web app? -
we've got lot of calls our logging methods (that wrap console.log) throughout our js in our mvc3 web app , i'd remove them javascript when build our test , production builds.
currently we're using bundling , minification nuget package bundle , minify our js 1 big minified file i'd have rip out calls logging methods well.
we have mechanism in place replaces logging methods empty functions won't work in production, still called , various arguments passed in. on top of this, there "large" strings passed , removed, reducing filesize.
the ideal solution in mind somehow parse javascript , detect / remove calls methods. preferably in sort of javascript engine , not regular expression.
either way, want calls logging methods removed in final javascript served in production. know how i'd accomplish additional minification?
yep, ibundletransform interface designed scenario. in rc bits here's envisioned:
new bundle("~/bundles/js", new logremovertransform(), new jsminify()); basically, construct bundle , chain 2 transforms, first stripping log methods, , running through normal minification. prior rc, have composition inside of ibundletransform.
Comments
Post a Comment