uglifyjs2

Source maps with grunt

六眼飞鱼酱① 提交于 2019-11-27 16:38:23
问题 Do you know of a workflow that includes source maps for an app compiled with grunt? I am well aware of plugins like uglifyjs that allow you to simply generate a source map. But I'm looking for incorporating this into a more complex workflow, rather than just making a one-off source map. I've noticed that the most popular Yeoman generators (that I know of) are missing source maps in their workflows. Is this just because of a lack of support in the major plugins for source maps? Or is it

Can uglify-js remove the console.log statements?

孤街浪徒 提交于 2019-11-26 19:27:49
问题 I'm using uglify-js to minify the source code. I want to remove the console.log statements of the original source code. Is it possible? Or is there any other compressor tool supports this? I use the code as below in Node.js. var uglify = require('uglify-js'); var originalSourceCode = 'var name = function(){var str = "test"; return str}; console.log("log data");'; var minifiedCode = uglify.minify(originalSourceCode, { fromString : true, mangle: {}, warnings: true }); console.log(minifiedCode);