{"action":"opened","issue":{"url":"https://api.github.com/repos/webpackmonitor/webpackmonitor/issues/114","repository_url":"https://api.github.com/repos/webpackmonitor/webpackmonitor","labels_url":"https://api.github.com/repos/webpackmonitor/webpackmonitor/issues/114/labels{/name}","comments_url":"https://api.github.com/repos/webpackmonitor/webpackmonitor/issues/114/comments","events_url":"https://api.github.com/repos/webpackmonitor/webpackmonitor/issues/114/events","html_url":"https://github.com/webpackmonitor/webpackmonitor/issues/114","id":395128921,"node_id":"MDU6SXNzdWUzOTUxMjg5MjE=","number":114,"title":"Fails when using multiple entry points and html-webpack-plugin","user":{"login":"michaelprescott","id":137704,"node_id":"MDQ6VXNlcjEzNzcwNA==","avatar_url":"https://avatars3.githubusercontent.com/u/137704?v=4","gravatar_id":"","url":"https://api.github.com/users/michaelprescott","html_url":"https://github.com/michaelprescott","followers_url":"https://api.github.com/users/michaelprescott/followers","following_url":"https://api.github.com/users/michaelprescott/following{/other_user}","gists_url":"https://api.github.com/users/michaelprescott/gists{/gist_id}","starred_url":"https://api.github.com/users/michaelprescott/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/michaelprescott/subscriptions","organizations_url":"https://api.github.com/users/michaelprescott/orgs","repos_url":"https://api.github.com/users/michaelprescott/repos","events_url":"https://api.github.com/users/michaelprescott/events{/privacy}","received_events_url":"https://api.github.com/users/michaelprescott/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2019-01-02T01:17:38Z","updated_at":"2019-01-02T01:17:38Z","closed_at":null,"author_association":"NONE","body":"I love this plugin!  I was working on something similar when I stumbled across it when researching webpack performance tips.  It's exactly what I need, except it's breaking down a bit on some of my projects.\r\n\r\nThe output monitor/stats.json is invalid JSON when webpack config has multiple entry points and multiple html-webpack-plugin configurations.\r\n\r\nAbbreviated webpack config:\r\n`{\r\n    \"stats\": { \"all\": true },\r\n    \"entry\": { \r\n        \"index\": \"./src/index.ts\", \r\n        \"introduction\": \"./src/introduction.ts\" \r\n    },\r\n    \"output\": {\r\n        \"filename\": \"[name].js\",\r\n        \"path\": \"/dist\"\r\n    },\r\n    \"plugins\": [\r\n        new HtmlWebpackPlugin({...}), \r\n        new HtmlWebpackPlugin({...}), \r\n        new WebpackMonitor({\r\n            capture: true,\r\n            launch: true,\r\n        })\r\n    ]\r\n}\r\n`\r\n\r\nThrows error:\r\nSyntaxError: Unexpected token { in JSON at position 11860\r\n    at JSON.parse (<anonymous>)\r\n    at MonitorStats.apply (/node_modules/webpack-monitor/monitor.js:90:19)\r\n\r\n\r\nTwo blocks of stats are generated and written to the same stats.json:\r\n`[\r\n  {\r\n    \"timeStamp\": 1546382960936,\r\n    \"time\": 681,\r\n    \"hash\": \"57c5490ec58f180b3289\",\r\n    \"errors\": [],\r\n    \"size\": 7574,\r\n    \"assets\": [\r\n      {\r\n        \"name\": \"index.html\",\r\n        \"chunks\": [],\r\n        \"size\": 197\r\n      }...\r\n]  {   /* <<<<<----------- breakdown here */\r\n    \"timeStamp\": 1546384890703,\r\n    \"time\": 1010,\r\n    \"hash\": \"16e0f2209281944a260c\",\r\n    \"errors\": [],\r\n    \"size\": 15750,\r\n    \"assets\": [\r\n      {\r\n        \"name\": \"introduction.html\",\r\n        \"chunks\": [],\r\n        \"size\": 273\r\n      }...\r\n]`\r\n\r\nMaybe wrap the multiple stat blocks in an array and assign the array to a prop so that the viewer could handle the file?"}}
{"actor":{"display_login":"michaelprescott"}}