Files
api/rollup.config.mjs
T
Jaco 3c59a4d417 Single module bundle via rollup (#3731)
* Single module bundle via rollup

* use createBundle

* override all

* Update rollup.config.mjs

* Add bundle import

* Remove x-* packages

* Adjust

* Adjust

* Rebuild

* Internal helpers

* Adjust locations

* Bump common

* CHANGELOG

* Update rollup.config.mjs
2021-07-07 20:39:49 +02:00

39 lines
819 B
JavaScript

// Copyright 2017-2021 @polkadot/api authors & contributors
// SPDX-License-Identifier: Apache-2.0
import path from 'path';
import { createBundle } from '@polkadot/dev/config/rollup';
const pkgs = [
'@polkadot/api',
'@polkadot/api-contract',
'@polkadot/types'
];
const external = [
...pkgs,
'@polkadot/keyring',
'@polkadot/networks',
'@polkadot/util',
'@polkadot/util-crypto'
];
const entries = ['api-derive', 'rpc-core', 'rpc-provider', 'types-known'].map((p) => ({
find: `@polkadot/${p}`,
replacement: path.resolve(process.cwd(), `packages/${p}/build`)
}));
const overrides = {};
export default pkgs.map((pkg) => {
const override = (overrides[pkg] || {});
return createBundle({
external,
pkg,
...override,
entries: entries.concat(...(override.entries || []))
});
});