{"action":"closed","issue":{"url":"https://api.github.com/repos/kryptnostic/kryptnostic-js/issues/157","repository_url":"https://api.github.com/repos/kryptnostic/kryptnostic-js","labels_url":"https://api.github.com/repos/kryptnostic/kryptnostic-js/issues/157/labels{/name}","comments_url":"https://api.github.com/repos/kryptnostic/kryptnostic-js/issues/157/comments","events_url":"https://api.github.com/repos/kryptnostic/kryptnostic-js/issues/157/events","html_url":"https://github.com/kryptnostic/kryptnostic-js/issues/157","id":136564929,"number":157,"title":"Cannot fully minify with UglifyJS. Breaks build","user":{"login":"iansinnott","id":3154865,"avatar_url":"https://avatars.githubusercontent.com/u/3154865?v=3","gravatar_id":"","url":"https://api.github.com/users/iansinnott","html_url":"https://github.com/iansinnott","followers_url":"https://api.github.com/users/iansinnott/followers","following_url":"https://api.github.com/users/iansinnott/following{/other_user}","gists_url":"https://api.github.com/users/iansinnott/gists{/gist_id}","starred_url":"https://api.github.com/users/iansinnott/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iansinnott/subscriptions","organizations_url":"https://api.github.com/users/iansinnott/orgs","repos_url":"https://api.github.com/users/iansinnott/repos","events_url":"https://api.github.com/users/iansinnott/events{/privacy}","received_events_url":"https://api.github.com/users/iansinnott/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-02-26T01:13:04Z","updated_at":"2016-02-26T05:10:12Z","closed_at":"2016-02-26T05:10:12Z","body":"This lib doesn't seem to be fully minifyable using UglifyJS version `2.6.1`. This is a significant issue for two reason:\r\n\r\n* It will break any build that has a minification step using uglifyjs\r\n* At over 1mb unminified the umd bundle isn't suitable for unminified inclusion in a project\r\n\r\nI can reproduce by running uglifyjs directly on the command line like so:\r\n\r\n```\r\nuglifyjs --compress --mangle -- node_modules/kryptnostic-js/dist/kryptnostic.umd.js\r\n```\r\n\r\nThe script has been running for a few minutes now while I write up this issue and there hasn't been any new output since the initial warnings:\r\n\r\n```\r\nWARN: Side effects in initialization of unused variable support [node_modules/kryptnostic-js/dist/kryptnostic.umd.js:1185,9]\r\nWARN: Condition always true [node_modules/kryptnostic-js/dist/kryptnostic.umd.js:12576,7]\r\nWARN: Dropping unreachable code [node_modules/kryptnostic-js/dist/kryptnostic.umd.js:12590,8]\r\nWARN: Side effects in initialization of unused variable moduleExports [node_modules/kryptnostic-js/dist/kryptnostic.umd.js:519,7]\r\nWARN: Condition always true [node_modules/kryptnostic-js/dist/kryptnostic.umd.js:12629,100]\r\nWARN: Condition always true [node_modules/kryptnostic-js/dist/kryptnostic.umd.js:12906,190]\r\nWARN: Dropping unused function p [node_modules/kryptnostic-js/dist/kryptnostic.umd.js:12906,173129]\r\nWARN: Side effects in initialization of unused variable o [node_modules/kryptnostic-js/dist/kryptnostic.umd.js:12906,254423]\r\nWARN: Dropping unused variable n [node_modules/kryptnostic-js/dist/kryptnostic.umd.js:12906,225086]\r\nWARN: Dropping unused variable N [node_modules/kryptnostic-js/dist/kryptnostic.umd.js:12906,242497]\r\n```\r\n\r\nAfter some significant debugging it turned out that the `--compress` option is somehow causing uglify to hang and eventually fail after over an hour. Disabling this option in Webpack is doable, but it's certainly not ideal:\r\n\r\n```js\r\nnew webpack.optimize.UglifyJsPlugin({\r\n  screw_ie8: true,\r\n  compressor: false, // <-- disable compressor\r\n}),\r\n```\r\n\r\nThe compressor option is enabled by default because it's usually a free optimization that can be applied on top of a codebase. Not being able to use this option is not ideal for a library that's meant to be included in other projects.\r\n\r\nThis caveat should be added to the README so consumers of the lib are forewarned that simply including the library may break their production build."}}