{"action":"created","issue":{"url":"https://api.github.com/repos/VictorBjelkholm/ipfs-webpack-plugin/issues/1","repository_url":"https://api.github.com/repos/VictorBjelkholm/ipfs-webpack-plugin","labels_url":"https://api.github.com/repos/VictorBjelkholm/ipfs-webpack-plugin/issues/1/labels{/name}","comments_url":"https://api.github.com/repos/VictorBjelkholm/ipfs-webpack-plugin/issues/1/comments","events_url":"https://api.github.com/repos/VictorBjelkholm/ipfs-webpack-plugin/issues/1/events","html_url":"https://github.com/VictorBjelkholm/ipfs-webpack-plugin/issues/1","id":324221127,"node_id":"MDU6SXNzdWUzMjQyMjExMjc=","number":1,"title":"Chunks and assets iteration over IPFS & Never ending Process","user":{"login":"Asone","id":441960,"node_id":"MDQ6VXNlcjQ0MTk2MA==","avatar_url":"https://avatars1.githubusercontent.com/u/441960?v=4","gravatar_id":"","url":"https://api.github.com/users/Asone","html_url":"https://github.com/Asone","followers_url":"https://api.github.com/users/Asone/followers","following_url":"https://api.github.com/users/Asone/following{/other_user}","gists_url":"https://api.github.com/users/Asone/gists{/gist_id}","starred_url":"https://api.github.com/users/Asone/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Asone/subscriptions","organizations_url":"https://api.github.com/users/Asone/orgs","repos_url":"https://api.github.com/users/Asone/repos","events_url":"https://api.github.com/users/Asone/events{/privacy}","received_events_url":"https://api.github.com/users/Asone/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2018-05-17T23:35:04Z","updated_at":"2018-09-18T18:45:11Z","closed_at":null,"author_association":"NONE","body":"Hi, \r\n\r\nI made a few experimentations in order to fix two bugs annoted in your version of the plug-in. \r\n\r\nI had to rewrite most of the plug-in in order to be able to solve the bugs and this version doesn't do anything specific with the IFPS results. \r\n\r\nI don't know if that could fit to your needs but i thought that might help. You can see the [modified version here](https://github.com/Asone/ipfs-webpack-plugin/blob/bugfix/file_iteration/ipfs-webpack-plugin.js)\r\n\r\n####  Never ending process \r\n\r\nBug has been fixed by injecting an instance of IPFS into plugin's instance without start. \r\n\r\n` IPFSWebpackPlugin.prototype._ipfs = new IPFS({start: false});`\r\n\r\nOnce the compilation done, the IPFS instance is started and assets are iterated for processing in promises. \r\n\r\n```\r\nthis._ipfs.start() // start ipfs node\r\n        .then(res => {})\r\n        .catch(res => {});\r\n```\r\n\r\nThe promises chain allows us to stop the IPFS instance once our assets are processed over IPFS.\r\n\r\n```\r\nthis._ipfs.start() // start ipfs node\r\n        .then(res => {})\r\n        .then( res => {\r\n             this._ipfs.stop();\r\n        })\r\n        .catch(res => {});\r\n```\r\n\r\n####  assets iteration\r\n\r\nBug has been fixed by storing the list of assets generated into a plugin scoped variable.\r\nOnce compilation done, we iterate through each asset in order to add it through the ipfs instance. \r\n\r\nThe promises chain will allow to process the result of the added file to IPFS. Next step here is to inject the chunk assets into the index file generated through webpack. \r\n\r\nIn any case, thanks for the original development ! 👍 \r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/VictorBjelkholm/ipfs-webpack-plugin/issues/comments/422504418","html_url":"https://github.com/VictorBjelkholm/ipfs-webpack-plugin/issues/1#issuecomment-422504418","issue_url":"https://api.github.com/repos/VictorBjelkholm/ipfs-webpack-plugin/issues/1","id":422504418,"node_id":"MDEyOklzc3VlQ29tbWVudDQyMjUwNDQxOA==","user":{"login":"Asone","id":441960,"node_id":"MDQ6VXNlcjQ0MTk2MA==","avatar_url":"https://avatars1.githubusercontent.com/u/441960?v=4","gravatar_id":"","url":"https://api.github.com/users/Asone","html_url":"https://github.com/Asone","followers_url":"https://api.github.com/users/Asone/followers","following_url":"https://api.github.com/users/Asone/following{/other_user}","gists_url":"https://api.github.com/users/Asone/gists{/gist_id}","starred_url":"https://api.github.com/users/Asone/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Asone/subscriptions","organizations_url":"https://api.github.com/users/Asone/orgs","repos_url":"https://api.github.com/users/Asone/repos","events_url":"https://api.github.com/users/Asone/events{/privacy}","received_events_url":"https://api.github.com/users/Asone/received_events","type":"User","site_admin":false},"created_at":"2018-09-18T18:45:11Z","updated_at":"2018-09-18T18:45:11Z","author_association":"NONE","body":"@crazyrabbitLTC : you might want to give a try to [embark](https://github.com/embark-framework/embark) as it seems it is built to allow easy deployment for both back-end ( eth ) and front-end ( ipfs ) of Dapps. \r\n"}}
{"actor":{"display_login":"Asone"}}