{"id":15437429,"url":"https://github.com/victorb/ipfs-webpack-plugin","last_synced_at":"2026-02-25T21:05:41.619Z","repository":{"id":148376869,"uuid":"94623003","full_name":"victorb/ipfs-webpack-plugin","owner":"victorb","description":"Creates additional webpack assets for loading the assets via IPFS in the browser","archived":false,"fork":false,"pushed_at":"2017-06-17T19:38:32.000Z","size":559,"stargazers_count":10,"open_issues_count":2,"forks_count":4,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-28T13:58:25.867Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/victorb.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-06-17T12:41:06.000Z","updated_at":"2022-06-12T10:17:32.000Z","dependencies_parsed_at":null,"dependency_job_id":"fb2b1876-b4c5-47fe-9e65-3e022948191f","html_url":"https://github.com/victorb/ipfs-webpack-plugin","commit_stats":{"total_commits":3,"total_committers":1,"mean_commits":3.0,"dds":0.0,"last_synced_commit":"72defb582febb95406f90bb2ffdd754e1e8af29d"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/victorb/ipfs-webpack-plugin","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/victorb%2Fipfs-webpack-plugin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/victorb%2Fipfs-webpack-plugin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/victorb%2Fipfs-webpack-plugin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/victorb%2Fipfs-webpack-plugin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/victorb","download_url":"https://codeload.github.com/victorb/ipfs-webpack-plugin/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/victorb%2Fipfs-webpack-plugin/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29839981,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-25T20:42:33.054Z","status":"ssl_error","status_checked_at":"2026-02-25T20:42:21.322Z","response_time":61,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-01T18:56:52.541Z","updated_at":"2026-02-25T21:05:41.604Z","avatar_url":"https://github.com/victorb.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# IPFSWebpackPlugin\n\u003e Creates additional webpack assets for loading the assets via IPFS in the browser\n\nIPFSWebpackPlugin is a plugin for webpack that makes it easy for you to load\nyour generated assets via IPFS. It comes with a loader you can use instead\nof loading assets directly, and your assets will be loaded via the IPFS\nnetwork instead.\n\n## Table of Contents\n\n- [Security](#security)\n- [Background](#background)\n- [Install](#install)\n- [Usage](#usage)\n- [API](#api)\n- [Contribute](#contribute)\n- [License](#license)\n\n## Security\n\nIPFS provides content-addressing and IPFSWebpackPlugin embeds the hash directly\nin the source code, meaning that your application will for sure be the right\nthing loaded from the network.\n\nIPFSWebpackPlugin does make use of `eval` which executes the JavaScript received\nfrom IPFS.\n\n## Background\n\nIPFSWebpackPlugin was created to make the creation and loading of IPFS-powered\napplications as easy as possible. \n\nIt was created as one possible solution to https://github.com/ipfs/js-ipfs/issues/127\n\n## Install\n\n- Install with npm/yarn/your favorite node module manager\n    - `npm install ipfs-webpack-plugin` / `yarn add ipfs-webpack-plugin`\n- Incluide in your webpack configuration\n\n```\nconst IPFSWebpackPlugin = require('ipfs-webpack-plugin')\n// ...\nplugins: [new IPFSWebpackPlugin()]\n```\n\nReplace the lines where you import your webpack assets with the following:\n\n```\n\u003cscript src=\"dist/loader.js\"\u003e\u003c/script\u003e\n\u003cscript src=\"dist/ipfs.js\"\u003e\u003c/script\u003e\n```\n\n`loader.js` should be loaded before `ipfs.js` as the loader will show the spinner and wait\nfor IPFS to be included, unless a `Ipfs` instance already exists on the page.\n\nA full example can be seen by looking at the following files:\n\n- `webpack.config.js` \u003c webpack configuration using IPFSWebpackPlugin\n- `application.js` \u003c Tiny react application demonstration everything works\n- `index.html` \u003c HTML file loading `loader.js` and `ipfs.js`, ends up loading the React application above\n\nA full example can be seen in the file `webpack.config.js` in this repository\n\n### Configuration\n\n**NOT YET IMPLEMENTED**\n\nYou can provide options for the IPFS nodes used by IPFSWebpackPlugin (the loader + compiler)\n\n```\nplugins: [new IPFSWebpackPlugin({\n    compilerNode: {/* ipfs options */} // defaults to js-ipfs defaults\n    loaderNode: {/* ipfs options */} // defaults to js-ipfs defaults\n    spinner: true|false // defaults to true\n})]\n```\n\n## How it works?\n\n- When including the plugin in your webpack configuration, it starts listening for emission of assets and for compilation to be done\n- Once emission starts, it adds `loader.js` and `ipfs.js` to the outputted assets, so it's included in your build\n- Once compilation is done, it adds your assets to IPFS and modifies the outputted `loader.js` to include the hash for your application\n- When the application is then loaded in the browser, `loader.js` waits for a ipfs node to be available and then loads the application based on the hash\n- Finally, when the contents have been fully loaded, it calls `eval` with the application source, executing the code from your build\n\nAnd now you have your assets loaded from IPFS directly in the browser :)\n\n## Contribute\n\nContributions are highly welcome! Take a look at the issues and write a message if you have any questions.\n\nPRs are always welcome but recommended to open a issue discussing the planned contribution before.\n\n## License\n\n[MIT 2017 Victor Bjelkholm](./LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvictorb%2Fipfs-webpack-plugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvictorb%2Fipfs-webpack-plugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvictorb%2Fipfs-webpack-plugin/lists"}