{"action":"created","issue":{"url":"https://api.github.com/repos/stephenmathieson/grunt-obfuscator/issues/9","labels_url":"https://api.github.com/repos/stephenmathieson/grunt-obfuscator/issues/9/labels{/name}","comments_url":"https://api.github.com/repos/stephenmathieson/grunt-obfuscator/issues/9/comments","events_url":"https://api.github.com/repos/stephenmathieson/grunt-obfuscator/issues/9/events","html_url":"https://github.com/stephenmathieson/grunt-obfuscator/issues/9","id":92437308,"number":9,"title":"Uncaught ReferenceError: require is not defined","user":{"login":"napstercake","id":4595567,"avatar_url":"https://avatars.githubusercontent.com/u/4595567?v=3","gravatar_id":"","url":"https://api.github.com/users/napstercake","html_url":"https://github.com/napstercake","followers_url":"https://api.github.com/users/napstercake/followers","following_url":"https://api.github.com/users/napstercake/following{/other_user}","gists_url":"https://api.github.com/users/napstercake/gists{/gist_id}","starred_url":"https://api.github.com/users/napstercake/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/napstercake/subscriptions","organizations_url":"https://api.github.com/users/napstercake/orgs","repos_url":"https://api.github.com/users/napstercake/repos","events_url":"https://api.github.com/users/napstercake/events{/privacy}","received_events_url":"https://api.github.com/users/napstercake/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-07-01T17:11:04Z","updated_at":"2015-10-16T07:45:19Z","closed_at":null,"body":"I'm can not run a simple test to have an obfuscated file. I've been here around 2 days trying to resolve this error: \r\n\r\nUncaught ReferenceError: require is not defined\r\n\r\nPlease see my complete question here:\r\nhttp://stackoverflow.com/questions/31150558/obfuscating-js-files-with-grunt-obfuscator-uncaught-referenceerror-require-is\r\n\r\nAny light in the dark will be appreciated."},"comment":{"url":"https://api.github.com/repos/stephenmathieson/grunt-obfuscator/issues/comments/148639966","html_url":"https://github.com/stephenmathieson/grunt-obfuscator/issues/9#issuecomment-148639966","issue_url":"https://api.github.com/repos/stephenmathieson/grunt-obfuscator/issues/9","id":148639966,"user":{"login":"maxiwu","id":1551262,"avatar_url":"https://avatars.githubusercontent.com/u/1551262?v=3","gravatar_id":"","url":"https://api.github.com/users/maxiwu","html_url":"https://github.com/maxiwu","followers_url":"https://api.github.com/users/maxiwu/followers","following_url":"https://api.github.com/users/maxiwu/following{/other_user}","gists_url":"https://api.github.com/users/maxiwu/gists{/gist_id}","starred_url":"https://api.github.com/users/maxiwu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/maxiwu/subscriptions","organizations_url":"https://api.github.com/users/maxiwu/orgs","repos_url":"https://api.github.com/users/maxiwu/repos","events_url":"https://api.github.com/users/maxiwu/events{/privacy}","received_events_url":"https://api.github.com/users/maxiwu/received_events","type":"User","site_admin":false},"created_at":"2015-10-16T07:45:19Z","updated_at":"2015-10-16T07:45:19Z","body":"the output obfuscated file always end with (require,module); and this is causing the error. don't know if my grunt setting is the cause of this.\r\n\r\nI am obfuscating a simple alert(\"\"); with jquery stuff, I have jquery js with my simple.js in src folder. grunt like this \r\ngrunt.initConfig({\r\n        \r\n        pkg: grunt.file.readJSON('package.json'),\r\n        // 設定 JavaScript 壓縮 task\r\n     \r\n          obfuscator : {\r\n        \t  files: ['src/*.js'],\r\n        \t  entry: '<%= pkg.name %>.js',\r\n        \t  out: 'ofs/<%= pkg.name %>.ofs.js',\r\n        \t  strings: false,\r\n        \t  root: __dirname\r\n          }\r\n        }\r\n    });"}}