-
Notifications
You must be signed in to change notification settings - Fork 1.3k
How to use dist/index.min.js in node-cli #1859
Comments
The builds in From a technical standpoint it would be tricky to create a build for Node.js as it stands because it depends on crypto and storage modules that have a native component - i.e. they need to either be compiled for your system or provide a pre-built binary. If we wanted to provide a pre-built Node.js version we'd need to provide multiple builds for different systems and architectures that combine the builds for these native modules. Storage is pluggable so you could create a build that doesn't have any native modules by using the filesystem datastore instead of leveldb but you'd probably need to fork some of the crypto modules used by libp2p or use the browser build of libp2p-crypto (actually a standalone browser build doesn't look like it's being published to npm cc @jacobheun). If you're interested in creating such a build then I'd welcome a PR and would do my best to help with you any issues you encounter. I am interested in the possibility of someday providing pre-built "binaries" because for a user that is not using IPFS programmatically (they are just using the daemon) it'll be much faster to download and install and as you observed, space saving. cc @hugomrdias this is relevant to our conversation on pre-builds for iim. |
@alanshaw I'm seeing the dist folder on npm and the |
ahhh, my mistake! |
Thanks @alanshaw |
This is very interesting. I can try |
@alanshaw This shall need target:'node' in aegir/src/config/webpack.config.js Right? |
Yes I think you can override webpack settings in Aegir config. Also relavant: https://github.com/zeit/pkg (thanks @hugomrdias) |
Our aegir build is not meant for node things. Please open an issue in the ipfs/aegir with your use case and i'll have a look. In the mean time check either pkg @alanshaw mentioned or https://github.com/zeit/ncc and see if any of these fit your use case. |
Oh, well, I see. @cloudbitsum https://github.com/zeit/ncc is your thing. It would give you one require'able index.js |
Hi,
I am new so please excuse any basic questions? I am student in std-12 and learning IPFS. It looks great.
I want to know if there is any way to use index.min.js in node-cli.
I know that I can simply import ipfs by require("ipfs"). But the require() create a big node_module which is an issue for school project. Also I dont have option to build a browser based app.
So I am looking to use index.min.js in node-cli server side. Or some way to similarly generate a minified fine.
Doing a require of index.min.js gives error that window is missing.
Please help.
The text was updated successfully, but these errors were encountered: