{"action":"created","issue":{"url":"https://api.github.com/repos/sporto/assets-webpack-plugin/issues/24","labels_url":"https://api.github.com/repos/sporto/assets-webpack-plugin/issues/24/labels{/name}","comments_url":"https://api.github.com/repos/sporto/assets-webpack-plugin/issues/24/comments","events_url":"https://api.github.com/repos/sporto/assets-webpack-plugin/issues/24/events","html_url":"https://github.com/sporto/assets-webpack-plugin/pull/24","id":108748885,"number":24,"title":"Proposal for a more robust implementation.","user":{"login":"ju1ius","id":218404,"avatar_url":"https://avatars.githubusercontent.com/u/218404?v=3","gravatar_id":"","url":"https://api.github.com/users/ju1ius","html_url":"https://github.com/ju1ius","followers_url":"https://api.github.com/users/ju1ius/followers","following_url":"https://api.github.com/users/ju1ius/following{/other_user}","gists_url":"https://api.github.com/users/ju1ius/gists{/gist_id}","starred_url":"https://api.github.com/users/ju1ius/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ju1ius/subscriptions","organizations_url":"https://api.github.com/users/ju1ius/orgs","repos_url":"https://api.github.com/users/ju1ius/repos","events_url":"https://api.github.com/users/ju1ius/events{/privacy}","received_events_url":"https://api.github.com/users/ju1ius/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-09-28T21:18:02Z","updated_at":"2015-10-04T07:35:04Z","closed_at":"2015-10-04T07:33:42Z","pull_request":{"url":"https://api.github.com/repos/sporto/assets-webpack-plugin/pulls/24","html_url":"https://github.com/sporto/assets-webpack-plugin/pull/24","diff_url":"https://github.com/sporto/assets-webpack-plugin/pull/24.diff","patch_url":"https://github.com/sporto/assets-webpack-plugin/pull/24.patch"},"body":"Hi,\r\nI spent some type investigating a more robust way to map webpack's path templates to actual output files.\r\n\r\nI was hoping to find the perfect plugin event to hook into, but unfortunately most of them are undocumented (maybe because they are internal only).\r\n\r\nSo I wrote a small parser, that turns a path template string into a PathTemplate object (see `lib/pathTemplate.js` and `test/pathTemplate.test.js`).\r\n\r\nThis object holds information about the placeholders and static parts of the template string. These informations are used to create a regular expression that can match filenames against the original path template string.\r\n\r\nFor example the path template string `\"[name].[id]_[hash].js[query]\"` is internally converted to:\r\n\r\n```js\r\n/^.+?(\\.)\\d+(_)[0-9A-Fa-f]+(\\.js)(?:\\?.+?)?$/\r\n``` \r\n\r\nThis allows us to detect sourcemaps and hot updates in a reliable way."},"comment":{"url":"https://api.github.com/repos/sporto/assets-webpack-plugin/issues/comments/145324589","html_url":"https://github.com/sporto/assets-webpack-plugin/pull/24#issuecomment-145324589","issue_url":"https://api.github.com/repos/sporto/assets-webpack-plugin/issues/24","id":145324589,"user":{"login":"sporto","id":1005498,"avatar_url":"https://avatars.githubusercontent.com/u/1005498?v=3","gravatar_id":"","url":"https://api.github.com/users/sporto","html_url":"https://github.com/sporto","followers_url":"https://api.github.com/users/sporto/followers","following_url":"https://api.github.com/users/sporto/following{/other_user}","gists_url":"https://api.github.com/users/sporto/gists{/gist_id}","starred_url":"https://api.github.com/users/sporto/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sporto/subscriptions","organizations_url":"https://api.github.com/users/sporto/orgs","repos_url":"https://api.github.com/users/sporto/repos","events_url":"https://api.github.com/users/sporto/events{/privacy}","received_events_url":"https://api.github.com/users/sporto/received_events","type":"User","site_admin":false},"created_at":"2015-10-04T07:35:04Z","updated_at":"2015-10-04T07:35:04Z","body":"Thanks for the PR, You are right the plug-in is getting very complex because of all the flexibility webpack providers. Definitely removing the source maps will simplify it, but I don't really know if anyone is using this."}}