{"issue":{"created_at":"2011-11-05T09:23:49Z","state":"closed","updated_at":"2011-11-28T10:54:32Z","user":{"gravatar_id":"47f5970448318e42b2fa0de3fcd06d2d","id":248937,"url":"https://api.github.com/users/skyblue","avatar_url":"https://secure.gravatar.com/avatar/47f5970448318e42b2fa0de3fcd06d2d?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","login":"skyblue"},"comments":3,"body":"如 \r\n//@debug\r\nsome code.........\r\n/@debug end\r\n\r\nspm build的时候 自动清理掉@debug包起来的代码块,\r\n\r\n//@debug block1\r\nsome code.........\r\n/@debug  block1 end\r\n更进一步 可以自动匹配替换,不过感觉这样的话又过头了....","assignee":null,"id":2151225,"number":79,"pull_request":{"patch_url":null,"html_url":null,"diff_url":null},"labels":[],"title":"建议spm提供调试期代码的区块标注识别,在打包时清除或替换 #feature","closed_at":"2011-11-28T10:53:38Z","html_url":"https://github.com/seajs/spm/issues/79","url":"https://api.github.com/repos/seajs/spm/issues/79","milestone":{"created_at":"2011-10-31T12:23:15Z","state":"open","due_on":null,"closed_issues":9,"creator":{"gravatar_id":"db33090541526c03c798f82aa0a5dbaa","id":97227,"url":"https://api.github.com/users/lifesinger","avatar_url":"https://secure.gravatar.com/avatar/db33090541526c03c798f82aa0a5dbaa?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","login":"lifesinger"},"number":2,"description":"","title":"v0.4.0","url":"https://api.github.com/repos/seajs/spm/milestones/2","open_issues":7}},"action":"created","comment":{"created_at":"2011-11-28T10:54:32Z","updated_at":"2011-11-28T10:54:32Z","user":{"gravatar_id":"db33090541526c03c798f82aa0a5dbaa","id":97227,"url":"https://api.github.com/users/lifesinger","avatar_url":"https://secure.gravatar.com/avatar/db33090541526c03c798f82aa0a5dbaa?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","login":"lifesinger"},"body":"已经可以了。\r\n\r\n在 build-config.js 里，添加：\r\n\r\n````\r\nmodule.exports = {\r\n\r\n  compiler_options: {\r\n    'defines': {\r\n      DEBUG: ['string', '']\r\n    }\r\n  }\r\n\r\n};\r\n````\r\n\r\n等价于 `uglifyjs a.js --define DEBUG=false`","id":2895442,"url":"https://api.github.com/repos/seajs/spm/issues/comments/2895442"}}