@coasys/rollup-plugin-holochain
v0.0.3
Published
Rollup-plugin to load Holochain DNA or hApp bundle files as modules returning a string with base64 encoded binary data.
Readme
rollup-plugin-holochain
(former name: rollup-plugin-dna)
Rollup-plugin to load Holochain DNA or hApp bundle files as modules returning a string with base64 encoded binary data.
Usage
import dna from './hc-dna/languages.dna'
export const DNA = Buffer.from(dna, 'base64')
import happ from './hc-dna/workdir/my-app.happ'
export const BUNDLE = Buffer.from(dna, 'base64')Installation
npm i @coasys/rollup-plugin-holochain -DConfig
In your rollup.config.js:
import { dna, happ } from '@coasys/rollup-plugin-holochain`
export default {
...
plugins: [
dna(),
happ()
]
}The dna plugin will only load files ending with .dna and creates an export called dna, while the happ pluging will only load files ending with .happ and it creates an export called happ.
