{"action":"created","issue":{"url":"https://api.github.com/repos/TrySound/rollup-plugin-uglify/issues/13","repository_url":"https://api.github.com/repos/TrySound/rollup-plugin-uglify","labels_url":"https://api.github.com/repos/TrySound/rollup-plugin-uglify/issues/13/labels{/name}","comments_url":"https://api.github.com/repos/TrySound/rollup-plugin-uglify/issues/13/comments","events_url":"https://api.github.com/repos/TrySound/rollup-plugin-uglify/issues/13/events","html_url":"https://github.com/TrySound/rollup-plugin-uglify/issues/13","id":182346069,"number":13,"title":"Error transforming bundle with 'uglify' plugin","user":{"login":"ammar91","id":7683970,"avatar_url":"https://avatars.githubusercontent.com/u/7683970?v=3","gravatar_id":"","url":"https://api.github.com/users/ammar91","html_url":"https://github.com/ammar91","followers_url":"https://api.github.com/users/ammar91/followers","following_url":"https://api.github.com/users/ammar91/following{/other_user}","gists_url":"https://api.github.com/users/ammar91/gists{/gist_id}","starred_url":"https://api.github.com/users/ammar91/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ammar91/subscriptions","organizations_url":"https://api.github.com/users/ammar91/orgs","repos_url":"https://api.github.com/users/ammar91/repos","events_url":"https://api.github.com/users/ammar91/events{/privacy}","received_events_url":"https://api.github.com/users/ammar91/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":14,"created_at":"2016-10-11T19:00:12Z","updated_at":"2016-12-15T13:31:32Z","closed_at":"2016-12-15T06:08:35Z","body":"I have an Angular 2 sample app that's bundle up with Rollup, but it throws an error when using this plugin. It says\n\n> Error transforming bundle with 'uglify' plugin: SyntaxError: Unexpected token: name (AppComponent).\n\nThis is how my rollup.config.s looks like\n\n```\n\nimport rollup from 'rollup'\nimport nodeResolve from 'rollup-plugin-node-resolve'\nimport commonjs from 'rollup-plugin-commonjs';\nimport uglify from 'rollup-plugin-uglify';\n\nexport default {\n    entry: 'dist/app/main.js',\n    dest: 'dist/build.js', // output a single application bundle\n    sourceMap: false,\n    format: 'iife',\n    plugins: [\n        nodeResolve({ jsnext: true, module: true }),\n        commonjs({\n            namedExports: {\n                // left-hand side can be an absolute path, a path \n                // relative to the current directory, or the name \n                // of a module in node_modules \n                'node_modules/primeng/primeng.js': ['DialogModule']\n            },\n            include: ['node_modules/rxjs/**', 'node_modules/primeng/**']\n        }),\n        uglify()\n    ]\n}\n```\n"},"comment":{"url":"https://api.github.com/repos/TrySound/rollup-plugin-uglify/issues/comments/267327751","html_url":"https://github.com/TrySound/rollup-plugin-uglify/issues/13#issuecomment-267327751","issue_url":"https://api.github.com/repos/TrySound/rollup-plugin-uglify/issues/13","id":267327751,"user":{"login":"dotnetCarpenter","id":43763,"avatar_url":"https://avatars.githubusercontent.com/u/43763?v=3","gravatar_id":"","url":"https://api.github.com/users/dotnetCarpenter","html_url":"https://github.com/dotnetCarpenter","followers_url":"https://api.github.com/users/dotnetCarpenter/followers","following_url":"https://api.github.com/users/dotnetCarpenter/following{/other_user}","gists_url":"https://api.github.com/users/dotnetCarpenter/gists{/gist_id}","starred_url":"https://api.github.com/users/dotnetCarpenter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dotnetCarpenter/subscriptions","organizations_url":"https://api.github.com/users/dotnetCarpenter/orgs","repos_url":"https://api.github.com/users/dotnetCarpenter/repos","events_url":"https://api.github.com/users/dotnetCarpenter/events{/privacy}","received_events_url":"https://api.github.com/users/dotnetCarpenter/received_events","type":"User","site_admin":false},"created_at":"2016-12-15T13:31:32Z","updated_at":"2016-12-15T13:31:32Z","body":"@matt3224 I am using [yarn][1] and since uglify-js isn't in my dependency list but is a dependency of rollup-plugin-uglify, [yarn][1] won't let me uninstall uglify-js. Unfortunately, `yarn add --dev mishoo/UglifyJS2#harmony` does **not** install the correct branch, it just does nothing but report back everything is ok. I did a `git diff` between the two uglify-js branches and then looked into the uglify-js folder to see if I had any of the differences, when I found none, I deleted the folder and did `yarn add mishoo/UglifyJS2#harmony` to get the correct version.\r\n\r\nIf I remember correctly, then `npm un uglify-js` just delete the uglify-js folder and update your `package.json` if you have it there. So a manual delete should be the same.\r\n\r\nWhen I `yarn add mishoo/UglifyJS2#harmony`, without having uglify-js in `node_modules/`, the correct version of uglify-js will be installed. Had I done that initially, it might had work out from the beginning... But it's untested.\r\n\r\n[1]: https://yarnpkg.com/"}}
{"actor":{"display_login":"dotnetCarpenter"}}