* Single module bundle via rollup * Adjust naming * Allow multiple bundles (consistency) * Remove unused rollup plugins * Update rollup.config.js * preferConst * Rollup with dev build * Use createBundle * Update rollup.config.mjs * Add bundle entrypoint * Bump dev * Bump dev * Remove x-* overrides
27 lines
573 B
JavaScript
27 lines
573 B
JavaScript
// Copyright 2019-2021 @polkadot/wasm-crypto authors & contributors
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
|
|
import { createBundle } from '@polkadot/dev/config/rollup';
|
|
|
|
const pkgs = [
|
|
'@polkadot/wasm-crypto'
|
|
];
|
|
|
|
const external = [
|
|
...pkgs,
|
|
'@polkadot/util'
|
|
];
|
|
|
|
const overrides = {
|
|
'@polkadot/wasm-crypto': {
|
|
entries: ['asmjs', 'wasm'].map((p) => `wasm-crypto-${p}`).map((p) => ({
|
|
find: `@polkadot/${p}`,
|
|
replacement: `../../${p}/build`
|
|
}))
|
|
}
|
|
};
|
|
|
|
export default pkgs.map((pkg) =>
|
|
createBundle({ external, pkg, ...(overrides[pkg] || {}) })
|
|
);
|