{"action":"created","issue":{"url":"https://api.github.com/repos/greensock/GreenSock-JS/issues/114","repository_url":"https://api.github.com/repos/greensock/GreenSock-JS","labels_url":"https://api.github.com/repos/greensock/GreenSock-JS/issues/114/labels{/name}","comments_url":"https://api.github.com/repos/greensock/GreenSock-JS/issues/114/comments","events_url":"https://api.github.com/repos/greensock/GreenSock-JS/issues/114/events","html_url":"https://github.com/greensock/GreenSock-JS/issues/114","id":105936093,"number":114,"title":"Wish: Require/Import in NodeJS way.","user":{"login":"boyw165","id":6766554,"avatar_url":"https://avatars.githubusercontent.com/u/6766554?v=3","gravatar_id":"","url":"https://api.github.com/users/boyw165","html_url":"https://github.com/boyw165","followers_url":"https://api.github.com/users/boyw165/followers","following_url":"https://api.github.com/users/boyw165/following{/other_user}","gists_url":"https://api.github.com/users/boyw165/gists{/gist_id}","starred_url":"https://api.github.com/users/boyw165/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/boyw165/subscriptions","organizations_url":"https://api.github.com/users/boyw165/orgs","repos_url":"https://api.github.com/users/boyw165/repos","events_url":"https://api.github.com/users/boyw165/events{/privacy}","received_events_url":"https://api.github.com/users/boyw165/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":14,"created_at":"2015-09-11T03:03:27Z","updated_at":"2016-04-05T09:57:10Z","closed_at":null,"body":"Hi guys,\r\n\r\nI import it in NodeJS way and use `webpack` (instead of `bower`, cause `webpack` is more powerful) to compile. It will show error like following.\r\n\r\n```\r\nerror given was: ReferenceError: document is not defined\r\n  at Function.<anonymous> (/.../node_modules/gsap/src/minified/TweenMax.min.js:15:5081)\r\n  at [object Object].check (/.../node_modules/gsap/src/minified/TweenLite.min.js:12:817)\r\n  at new p (/.../node_modules/gsap/src/minified/TweenLite.min.js:12:1104)\r\n  at t._gsDefine (/.../node_modules/gsap/src/minified/TweenLite.min.js:12:1154)\r\n```\r\n\r\nI've read the article [thread](http://greensock.com/forums/topic/11484-using-gsap-with-nodejs/?p=46715) talking about this.\r\n\r\nThe current workaround for me is tell webpack (by adding rules in its configuration file) where to find the `TweenMax`, `TimelineMax`, and so, instead of requiring `gsap` cause it doesn't work for this moment.\r\n\r\ne.g. webpack.config.js\r\n\r\n```\r\n  resolve: {\r\n    alias: {\r\n      'TweenLite': path.resolve(MODULE_DIR, 'gsap/src/minified/TweenLite.min.js'),\r\n      'TweenMax': path.resolve(MODULE_DIR, 'gsap/src/minified/TweenMax.min.js'),\r\n      'TimelineLite': path.resolve(MODULE_DIR, 'gsap/src/minified/TimelineLite.min.js'),\r\n      'TimelineMax': path.resolve(MODULE_DIR, 'gsap/src/minified/TimelineMax.min.js'),\r\n      'EasePack': path.resolve(MODULE_DIR, 'gsap/src/minified/easing/EasePack.min.js')\r\n    }\r\n  }\r\n```\r\n\r\nActually I think it would be nice to use `gsap` like this:\r\n\r\n```\r\nimport {TweenMax, TimelineMax, Back, Quad} from 'gsap';\r\n```"},"comment":{"url":"https://api.github.com/repos/greensock/GreenSock-JS/issues/comments/205735800","html_url":"https://github.com/greensock/GreenSock-JS/issues/114#issuecomment-205735800","issue_url":"https://api.github.com/repos/greensock/GreenSock-JS/issues/114","id":205735800,"user":{"login":"dwilt","id":1065539,"avatar_url":"https://avatars.githubusercontent.com/u/1065539?v=3","gravatar_id":"","url":"https://api.github.com/users/dwilt","html_url":"https://github.com/dwilt","followers_url":"https://api.github.com/users/dwilt/followers","following_url":"https://api.github.com/users/dwilt/following{/other_user}","gists_url":"https://api.github.com/users/dwilt/gists{/gist_id}","starred_url":"https://api.github.com/users/dwilt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dwilt/subscriptions","organizations_url":"https://api.github.com/users/dwilt/orgs","repos_url":"https://api.github.com/users/dwilt/repos","events_url":"https://api.github.com/users/dwilt/events{/privacy}","received_events_url":"https://api.github.com/users/dwilt/received_events","type":"User","site_admin":false},"created_at":"2016-04-05T09:57:10Z","updated_at":"2016-04-05T09:57:10Z","body":"+1"}}