mirror of
https://github.com/pezkuwichain/pezkuwi-ui.git
synced 2026-06-12 03:51:03 +00:00
Browser bundle build (incomplete) (#503)
* Browser bundle build (incomplete) * globals
This commit is contained in:
@@ -13,6 +13,7 @@
|
||||
"scripts": {
|
||||
"build": "polkadot-dev-build-ts",
|
||||
"build:release": "polkadot-ci-ghact-build",
|
||||
"build:rollup": "polkadot-exec-rollup --config",
|
||||
"lint": "polkadot-dev-run-lint",
|
||||
"clean": "polkadot-dev-clean-build",
|
||||
"demo:identicon:react": "yarn build && webpack-serve --config packages/react-identicon/webpack.config.js --content packages/react-identicon --port 8080",
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
// Copyright 2017-2021 @polkadot/vue-identicon authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
export { Identicon } from './Identicon';
|
||||
|
||||
export { packageInfo } from './packageInfo';
|
||||
@@ -3,8 +3,8 @@
|
||||
|
||||
import './detectPackage';
|
||||
|
||||
import { Identicon } from './Identicon';
|
||||
import { Identicon } from './bundle';
|
||||
|
||||
export { packageInfo } from './packageInfo';
|
||||
export * from './bundle';
|
||||
|
||||
export default Identicon;
|
||||
|
||||
@@ -0,0 +1,56 @@
|
||||
// Copyright 2017-2021 @polkadot/ui authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import path from 'path';
|
||||
|
||||
import { createBundle } from '@polkadot/dev/config/rollup';
|
||||
|
||||
const pkgs = [
|
||||
'@polkadot/react-identicon',
|
||||
'@polkadot/react-qr',
|
||||
'@polkadot/ui-keyring',
|
||||
'@polkadot/ui-settings',
|
||||
'@polkadot/ui-shared',
|
||||
'@polkadot/vue-identicon'
|
||||
];
|
||||
|
||||
const external = [
|
||||
...pkgs,
|
||||
'@polkadot/keyring',
|
||||
'@polkadot/util',
|
||||
'@polkadot/util-crypto',
|
||||
'react',
|
||||
'react-dom',
|
||||
'vue'
|
||||
];
|
||||
|
||||
const globals = {
|
||||
react: 'React',
|
||||
'react-dom': 'ReactDOM',
|
||||
vue: 'Vue'
|
||||
};
|
||||
|
||||
const entries = ['api-derive', 'rpc-core', 'rpc-provider', 'types-known'].reduce((all, p) => ({
|
||||
...all,
|
||||
[`@polkadot/${p}`]: path.resolve(process.cwd(), `packages/${p}/build/bundle.js`)
|
||||
}), {
|
||||
// re-exported in @polkadot/util-crypto, map directly
|
||||
'@polkadot/networks': '@polkadot/util-crypto'
|
||||
});
|
||||
|
||||
const overrides = {};
|
||||
|
||||
export default pkgs.map((pkg) => {
|
||||
const override = (overrides[pkg] || {});
|
||||
|
||||
return createBundle({
|
||||
external,
|
||||
globals,
|
||||
pkg,
|
||||
...override,
|
||||
entries: {
|
||||
...entries,
|
||||
...(override.entries || {})
|
||||
}
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user