@buidlerlabs/rollup-plugin-hedera-strato v0.8.0
Hedera Strato Rollup
... rollup's best friend for bundling Strato
Quick. No questions asked, TL;LDR;
Do a
npm install --save-dev @buidlerlabs/rollup-plugin-hedera-strato
then, in your rollup.config.json
or any other Rollup config option of preference, do
import strato from "@buidlerlabs/rollup-plugin-hedera-strato";
//...
export default {
//...
plugins: [
strato(),
//...
]
//...
}
That's it! ๐พ Now you can bundle your dApp and have Strato embedded in it, ready to be used. ๐ฅ
Config-ing
You can configure the plugin by passing in an object with the following properties and meaning:
Prop | Description |
---|---|
contracts.path | Where to load the solidity contracts from |
contracts.recurse | true to deep load all the inner directory's contracts from contracts.path , false to only load the provided top directory |
environment | The environment object passed to Strato to be used when creating ApiSession.default instances |
includeCompiler | true to embed a web-worker that will allow in-browser compilation (note: the solidity compiler is lazy loaded the first time a Contract.newFrom /Contract.allFrom is called) and false if you don't intend to use this feature (conserves bandwidth) |
sourceMap | true to include the source-map (helpful for debugging), false otherwise |
Embedding the plugin with no such object is equivalent to virtually calling:
strato({
contracts: {
path: './contracts',
recurse: false
},
environment: process.env,
includeCompiler: false,
sourceMap: false
})
For an immediate working example, have a look at our bundler recipe used by our test-base.
Further docs
Need more context and configurability? Check our official docs page for more info.
Testing it
Have the .env
file ready (see above) and run
$ npm test
Contributions
... are more then welcome! Head over to our issues page and let us know your thoughts or, better yet, open that PR and lets discuss it there!
Oh! And if you ever feel like talking to us, you can reach us on discord. We're very friendly! ๐จโ๐ฉโ๐งโ๐ฆ
License
This work has been published under the MIT License.