Skip to content
This repository has been archived by the owner on Feb 12, 2024. It is now read-only.

Commit

Permalink
fix: make our bundle include all formats
Browse files Browse the repository at this point in the history
  • Loading branch information
hugomrdias committed Apr 12, 2019
1 parent e6abfe0 commit eafef16
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 1 deletion.
3 changes: 2 additions & 1 deletion .aegir.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ const preloadNode = MockPreloadNode.createNode()
module.exports = {
webpack: {
resolve: {
mainFields: ['browser', 'main']
mainFields: ['browser', 'main'],
aliasFields: ['browser', 'browser-all-ipld-formats'],
}
},
karma: {
Expand Down
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@
"stream": "readable-stream",
"joi": "joi-browser"
},
"browser-all-ipld-formats": {
"./src/core/runtime/ipld-browser.js": "./src/core/runtime/ipld-browser-all.js"
},
"engines": {
"node": ">=10.0.0",
"npm": ">=6.0.0"
Expand Down
26 changes: 26 additions & 0 deletions src/core/runtime/ipld-browser-all.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
'use strict'
const mergeOptions = require('merge-options')

module.exports = (blockService, options = {}) => {
return mergeOptions.call(
// ensure we have the defaults formats even if the user overrides `formats: []`
{ concatArrays: true },
{
blockService: blockService,
formats: [
require('ipld-dag-cbor'),
require('ipld-dag-pb'),
require('ipld-raw'),
require('ipld-bitcoin'),
require('ipld-ethereum').ethAccountSnapshot,
require('ipld-ethereum').ethBlock,
require('ipld-ethereum').ethBlockList,
require('ipld-ethereum').ethStateTrie,
require('ipld-ethereum').ethStorageTrie,
require('ipld-ethereum').ethTx,
require('ipld-ethereum').ethTxTrie,
require('ipld-git'),
require('ipld-zcash')
]
}, options)
}

0 comments on commit eafef16

Please sign in to comment.