Skip to content
This repository was archived by the owner on May 26, 2023. It is now read-only.

Commit 3d20406

Browse files
authored
Merge pull request #270 from Zilliqa/feat/bundleweb
feat: bundle web library
2 parents e0572cf + 266adca commit 3d20406

39 files changed

+51815
-6
lines changed

.prettierignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
#################################
44
.tmp/
55
node_modules/
6+
examples/webpack/
67
package.json
78
.travis.yml
89
*.md
10+
*.html

README.md

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -396,17 +396,21 @@ yarn link @zilliqa-js/zilliqa
396396

397397
### Bundling
398398

399-
`zilliqa-js` is bundled using `rollup`. Unfortunately, because `elliptic` is
400-
a major dependency and contains a circular dependency that causes `rollup` to
401-
choke, we also make use of `webpack` to pre-process and thereby eliminate the
402-
problem.
399+
#### rollup
403400

404-
To build the distributable bundles, simple run `yarn bundle`. This will output
405-
two bundles, `*.umd.js` and `*.esm.js`, to `packages/*/dist`. Node.js clients
401+
`zilliqa-js` is bundled using `rollup`. To build the distributable bundles, simple run `yarn bundle`.
402+
This will output two bundles, `*.umd.js` and `*.esm.js`, to `packages/*/dist`. Node.js clients
406403
are pointed to the `umd` bundle, and bundlers are pointed to `esm`.
407404

408405
*NOTE: these bundles are _not_ minified.*
409406

407+
#### webpack
408+
409+
To build an all-in-one static js file, first install `webpack` globally using `yarn global add webpack`. Then run `yarn build:web`.
410+
This will generate a `dist` folder in the current path, which contains a file called `zilliqa.min.js`. It can be used in normal html file. (A more specific example please refer to `example/webpack`)
411+
412+
*NOTE: there may be some issue to install webpack with npm, thus using yarn is a recommended way*
413+
410414
## Licence
411415

412416
You can view our [licence here](LICENSE).
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)