{"action":"reopened","number":69,"pull_request":{"url":"https://api.github.com/repos/ampedandwired/html-webpack-plugin/pulls/69","id":39794598,"html_url":"https://github.com/ampedandwired/html-webpack-plugin/pull/69","diff_url":"https://github.com/ampedandwired/html-webpack-plugin/pull/69.diff","patch_url":"https://github.com/ampedandwired/html-webpack-plugin/pull/69.patch","issue_url":"https://api.github.com/repos/ampedandwired/html-webpack-plugin/issues/69","number":69,"state":"open","locked":false,"title":"Adding the file size to the chunk object","user":{"login":"shprink","id":1388706,"avatar_url":"https://avatars.githubusercontent.com/u/1388706?v=3","gravatar_id":"","url":"https://api.github.com/users/shprink","html_url":"https://github.com/shprink","followers_url":"https://api.github.com/users/shprink/followers","following_url":"https://api.github.com/users/shprink/following{/other_user}","gists_url":"https://api.github.com/users/shprink/gists{/gist_id}","starred_url":"https://api.github.com/users/shprink/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shprink/subscriptions","organizations_url":"https://api.github.com/users/shprink/orgs","repos_url":"https://api.github.com/users/shprink/repos","events_url":"https://api.github.com/users/shprink/events{/privacy}","received_events_url":"https://api.github.com/users/shprink/received_events","type":"User","site_admin":false},"body":"As far as I know, getting the file size within the template is not possible.\r\n\r\nI added a way to get it like this: ``` {%=o.htmlWebpackPlugin.files.chunks.main.size %}```\r\n\r\nThe file size is important in my case in order to have a progress loader via http request so I can do something like that:\r\n\r\n```\r\nfunction ajax(url, onProgress, callback, data, x) {\r\n            try {\r\n                x = new(this.XMLHttpRequest || ActiveXObject)('MSXML2.XMLHTTP.3.0');\r\n                x.open(data ? 'POST' : 'GET', url, 1);\r\n                x.setRequestHeader('X-Requested-With', 'XMLHttpRequest');\r\n                x.setRequestHeader('Content-type', 'application/x-www-form-urlencoded');\r\n                x.onreadystatechange = function() {\r\n                    x.readyState > 3 && callback && callback(x.responseText, x);\r\n                };\r\n                x.addEventListener(\"progress\", onProgress, false);\r\n                x.send(data)\r\n            } catch (e) {\r\n                window.console && console.log(e);\r\n            }\r\n        };\r\n\r\n        function onLoad(responseText) {\r\n            var script = document.createElement('script');\r\n            script.setAttribute('type', 'text/javascript');\r\n            if (script.text) {\r\n                script.text = content; // IE\r\n            } else {\r\n                script.appendChild(document.createTextNode(responseText));\r\n            }\r\n            document.getElementsByTagName('head')[0].appendChild(script);\r\n            document.getElementById('appLoader').className = 'finished';\r\n        }\r\n\r\n        function onProgress(e) {\r\n            var progress = Math.floor((e.loaded / {%=o.htmlWebpackPlugin.files.chunks.main.size %} || 0) * 100);\r\n            document.getElementById('appLoader').setAttribute(\"value\", progress);\r\n            document.getElementById('appLoaderPercent').innerText = document.createTextNode(progress).textContent;\r\n        }\r\n\r\n        ajax('./{%=o.htmlWebpackPlugin.files.chunks.main.entry %}', onProgress, onLoad);\r\n```","created_at":"2015-07-13T09:46:07Z","updated_at":"2015-07-13T09:59:18Z","closed_at":null,"merged_at":null,"merge_commit_sha":"667221db5267dd8690babe399269de32989ace9e","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/ampedandwired/html-webpack-plugin/pulls/69/commits","review_comments_url":"https://api.github.com/repos/ampedandwired/html-webpack-plugin/pulls/69/comments","review_comment_url":"https://api.github.com/repos/ampedandwired/html-webpack-plugin/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ampedandwired/html-webpack-plugin/issues/69/comments","statuses_url":"https://api.github.com/repos/ampedandwired/html-webpack-plugin/statuses/dfb4f5717904c4bd70b24184740dec807aa27eff","head":{"label":"shprink:patch-1","ref":"patch-1","sha":"dfb4f5717904c4bd70b24184740dec807aa27eff","user":{"login":"shprink","id":1388706,"avatar_url":"https://avatars.githubusercontent.com/u/1388706?v=3","gravatar_id":"","url":"https://api.github.com/users/shprink","html_url":"https://github.com/shprink","followers_url":"https://api.github.com/users/shprink/followers","following_url":"https://api.github.com/users/shprink/following{/other_user}","gists_url":"https://api.github.com/users/shprink/gists{/gist_id}","starred_url":"https://api.github.com/users/shprink/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shprink/subscriptions","organizations_url":"https://api.github.com/users/shprink/orgs","repos_url":"https://api.github.com/users/shprink/repos","events_url":"https://api.github.com/users/shprink/events{/privacy}","received_events_url":"https://api.github.com/users/shprink/received_events","type":"User","site_admin":false},"repo":{"id":39003492,"name":"html-webpack-plugin","full_name":"shprink/html-webpack-plugin","owner":{"login":"shprink","id":1388706,"avatar_url":"https://avatars.githubusercontent.com/u/1388706?v=3","gravatar_id":"","url":"https://api.github.com/users/shprink","html_url":"https://github.com/shprink","followers_url":"https://api.github.com/users/shprink/followers","following_url":"https://api.github.com/users/shprink/following{/other_user}","gists_url":"https://api.github.com/users/shprink/gists{/gist_id}","starred_url":"https://api.github.com/users/shprink/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shprink/subscriptions","organizations_url":"https://api.github.com/users/shprink/orgs","repos_url":"https://api.github.com/users/shprink/repos","events_url":"https://api.github.com/users/shprink/events{/privacy}","received_events_url":"https://api.github.com/users/shprink/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/shprink/html-webpack-plugin","description":"Simplifies creation of HTML files to serve your webpack bundles","fork":true,"url":"https://api.github.com/repos/shprink/html-webpack-plugin","forks_url":"https://api.github.com/repos/shprink/html-webpack-plugin/forks","keys_url":"https://api.github.com/repos/shprink/html-webpack-plugin/keys{/key_id}","collaborators_url":"https://api.github.com/repos/shprink/html-webpack-plugin/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/shprink/html-webpack-plugin/teams","hooks_url":"https://api.github.com/repos/shprink/html-webpack-plugin/hooks","issue_events_url":"https://api.github.com/repos/shprink/html-webpack-plugin/issues/events{/number}","events_url":"https://api.github.com/repos/shprink/html-webpack-plugin/events","assignees_url":"https://api.github.com/repos/shprink/html-webpack-plugin/assignees{/user}","branches_url":"https://api.github.com/repos/shprink/html-webpack-plugin/branches{/branch}","tags_url":"https://api.github.com/repos/shprink/html-webpack-plugin/tags","blobs_url":"https://api.github.com/repos/shprink/html-webpack-plugin/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/shprink/html-webpack-plugin/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/shprink/html-webpack-plugin/git/refs{/sha}","trees_url":"https://api.github.com/repos/shprink/html-webpack-plugin/git/trees{/sha}","statuses_url":"https://api.github.com/repos/shprink/html-webpack-plugin/statuses/{sha}","languages_url":"https://api.github.com/repos/shprink/html-webpack-plugin/languages","stargazers_url":"https://api.github.com/repos/shprink/html-webpack-plugin/stargazers","contributors_url":"https://api.github.com/repos/shprink/html-webpack-plugin/contributors","subscribers_url":"https://api.github.com/repos/shprink/html-webpack-plugin/subscribers","subscription_url":"https://api.github.com/repos/shprink/html-webpack-plugin/subscription","commits_url":"https://api.github.com/repos/shprink/html-webpack-plugin/commits{/sha}","git_commits_url":"https://api.github.com/repos/shprink/html-webpack-plugin/git/commits{/sha}","comments_url":"https://api.github.com/repos/shprink/html-webpack-plugin/comments{/number}","issue_comment_url":"https://api.github.com/repos/shprink/html-webpack-plugin/issues/comments{/number}","contents_url":"https://api.github.com/repos/shprink/html-webpack-plugin/contents/{+path}","compare_url":"https://api.github.com/repos/shprink/html-webpack-plugin/compare/{base}...{head}","merges_url":"https://api.github.com/repos/shprink/html-webpack-plugin/merges","archive_url":"https://api.github.com/repos/shprink/html-webpack-plugin/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/shprink/html-webpack-plugin/downloads","issues_url":"https://api.github.com/repos/shprink/html-webpack-plugin/issues{/number}","pulls_url":"https://api.github.com/repos/shprink/html-webpack-plugin/pulls{/number}","milestones_url":"https://api.github.com/repos/shprink/html-webpack-plugin/milestones{/number}","notifications_url":"https://api.github.com/repos/shprink/html-webpack-plugin/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/shprink/html-webpack-plugin/labels{/name}","releases_url":"https://api.github.com/repos/shprink/html-webpack-plugin/releases{/id}","created_at":"2015-07-13T09:37:31Z","updated_at":"2015-07-13T09:37:32Z","pushed_at":"2015-07-13T09:43:18Z","git_url":"git://github.com/shprink/html-webpack-plugin.git","ssh_url":"git@github.com:shprink/html-webpack-plugin.git","clone_url":"https://github.com/shprink/html-webpack-plugin.git","svn_url":"https://github.com/shprink/html-webpack-plugin","homepage":"","size":731,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"ampedandwired:master","ref":"master","sha":"c630d339c6c012f3962376ff2ff7a23c65c73bc5","user":{"login":"ampedandwired","id":541054,"avatar_url":"https://avatars.githubusercontent.com/u/541054?v=3","gravatar_id":"","url":"https://api.github.com/users/ampedandwired","html_url":"https://github.com/ampedandwired","followers_url":"https://api.github.com/users/ampedandwired/followers","following_url":"https://api.github.com/users/ampedandwired/following{/other_user}","gists_url":"https://api.github.com/users/ampedandwired/gists{/gist_id}","starred_url":"https://api.github.com/users/ampedandwired/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ampedandwired/subscriptions","organizations_url":"https://api.github.com/users/ampedandwired/orgs","repos_url":"https://api.github.com/users/ampedandwired/repos","events_url":"https://api.github.com/users/ampedandwired/events{/privacy}","received_events_url":"https://api.github.com/users/ampedandwired/received_events","type":"User","site_admin":false},"repo":{"id":22744595,"name":"html-webpack-plugin","full_name":"ampedandwired/html-webpack-plugin","owner":{"login":"ampedandwired","id":541054,"avatar_url":"https://avatars.githubusercontent.com/u/541054?v=3","gravatar_id":"","url":"https://api.github.com/users/ampedandwired","html_url":"https://github.com/ampedandwired","followers_url":"https://api.github.com/users/ampedandwired/followers","following_url":"https://api.github.com/users/ampedandwired/following{/other_user}","gists_url":"https://api.github.com/users/ampedandwired/gists{/gist_id}","starred_url":"https://api.github.com/users/ampedandwired/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ampedandwired/subscriptions","organizations_url":"https://api.github.com/users/ampedandwired/orgs","repos_url":"https://api.github.com/users/ampedandwired/repos","events_url":"https://api.github.com/users/ampedandwired/events{/privacy}","received_events_url":"https://api.github.com/users/ampedandwired/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ampedandwired/html-webpack-plugin","description":"Simplifies creation of HTML files to serve your webpack bundles","fork":false,"url":"https://api.github.com/repos/ampedandwired/html-webpack-plugin","forks_url":"https://api.github.com/repos/ampedandwired/html-webpack-plugin/forks","keys_url":"https://api.github.com/repos/ampedandwired/html-webpack-plugin/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ampedandwired/html-webpack-plugin/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ampedandwired/html-webpack-plugin/teams","hooks_url":"https://api.github.com/repos/ampedandwired/html-webpack-plugin/hooks","issue_events_url":"https://api.github.com/repos/ampedandwired/html-webpack-plugin/issues/events{/number}","events_url":"https://api.github.com/repos/ampedandwired/html-webpack-plugin/events","assignees_url":"https://api.github.com/repos/ampedandwired/html-webpack-plugin/assignees{/user}","branches_url":"https://api.github.com/repos/ampedandwired/html-webpack-plugin/branches{/branch}","tags_url":"https://api.github.com/repos/ampedandwired/html-webpack-plugin/tags","blobs_url":"https://api.github.com/repos/ampedandwired/html-webpack-plugin/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ampedandwired/html-webpack-plugin/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ampedandwired/html-webpack-plugin/git/refs{/sha}","trees_url":"https://api.github.com/repos/ampedandwired/html-webpack-plugin/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ampedandwired/html-webpack-plugin/statuses/{sha}","languages_url":"https://api.github.com/repos/ampedandwired/html-webpack-plugin/languages","stargazers_url":"https://api.github.com/repos/ampedandwired/html-webpack-plugin/stargazers","contributors_url":"https://api.github.com/repos/ampedandwired/html-webpack-plugin/contributors","subscribers_url":"https://api.github.com/repos/ampedandwired/html-webpack-plugin/subscribers","subscription_url":"https://api.github.com/repos/ampedandwired/html-webpack-plugin/subscription","commits_url":"https://api.github.com/repos/ampedandwired/html-webpack-plugin/commits{/sha}","git_commits_url":"https://api.github.com/repos/ampedandwired/html-webpack-plugin/git/commits{/sha}","comments_url":"https://api.github.com/repos/ampedandwired/html-webpack-plugin/comments{/number}","issue_comment_url":"https://api.github.com/repos/ampedandwired/html-webpack-plugin/issues/comments{/number}","contents_url":"https://api.github.com/repos/ampedandwired/html-webpack-plugin/contents/{+path}","compare_url":"https://api.github.com/repos/ampedandwired/html-webpack-plugin/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ampedandwired/html-webpack-plugin/merges","archive_url":"https://api.github.com/repos/ampedandwired/html-webpack-plugin/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ampedandwired/html-webpack-plugin/downloads","issues_url":"https://api.github.com/repos/ampedandwired/html-webpack-plugin/issues{/number}","pulls_url":"https://api.github.com/repos/ampedandwired/html-webpack-plugin/pulls{/number}","milestones_url":"https://api.github.com/repos/ampedandwired/html-webpack-plugin/milestones{/number}","notifications_url":"https://api.github.com/repos/ampedandwired/html-webpack-plugin/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ampedandwired/html-webpack-plugin/labels{/name}","releases_url":"https://api.github.com/repos/ampedandwired/html-webpack-plugin/releases{/id}","created_at":"2014-08-08T03:19:15Z","updated_at":"2015-07-13T08:31:03Z","pushed_at":"2015-07-13T09:46:08Z","git_url":"git://github.com/ampedandwired/html-webpack-plugin.git","ssh_url":"git@github.com:ampedandwired/html-webpack-plugin.git","clone_url":"https://github.com/ampedandwired/html-webpack-plugin.git","svn_url":"https://github.com/ampedandwired/html-webpack-plugin","homepage":"","size":731,"stargazers_count":139,"watchers_count":139,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":29,"mirror_url":null,"open_issues_count":7,"forks":29,"open_issues":7,"watchers":139,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ampedandwired/html-webpack-plugin/pulls/69"},"html":{"href":"https://github.com/ampedandwired/html-webpack-plugin/pull/69"},"issue":{"href":"https://api.github.com/repos/ampedandwired/html-webpack-plugin/issues/69"},"comments":{"href":"https://api.github.com/repos/ampedandwired/html-webpack-plugin/issues/69/comments"},"review_comments":{"href":"https://api.github.com/repos/ampedandwired/html-webpack-plugin/pulls/69/comments"},"review_comment":{"href":"https://api.github.com/repos/ampedandwired/html-webpack-plugin/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ampedandwired/html-webpack-plugin/pulls/69/commits"},"statuses":{"href":"https://api.github.com/repos/ampedandwired/html-webpack-plugin/statuses/dfb4f5717904c4bd70b24184740dec807aa27eff"}},"merged":false,"mergeable":null,"mergeable_state":"unknown","merged_by":null,"comments":1,"review_comments":0,"commits":1,"additions":1,"deletions":0,"changed_files":1}}