From 92129afd38ff08ec83e3618c877b4a9e45cb8cb6 Mon Sep 17 00:00:00 2001 From: Nex Zhu <4370605+NexZhu@users.noreply.github.com> Date: Sat, 18 Mar 2023 19:55:44 +0800 Subject: [PATCH] chore: build axios-fetch for test --- package.json | 3 +- rollup.config.ts | 38 +++++---- test/http.html | 213 ++++++++++++++++++++++++----------------------- 3 files changed, 134 insertions(+), 120 deletions(-) diff --git a/package.json b/package.json index b14a441..26fd5d9 100644 --- a/package.json +++ b/package.json @@ -43,11 +43,10 @@ "prettier": "^2.7.1", "rollup": "^2.79.1", "rollup-plugin-dts": "^4.2.2", - "@rollup/plugin-node-resolve": "^15.0.1", "rollup-plugin-terser": "^7.0.2", "rollup-plugin-typescript2": "^0.34.1", "shx": "^0.3.4", "sucrase": "^3.25.0", "typescript": "^4.8.2" } -} +} \ No newline at end of file diff --git a/rollup.config.ts b/rollup.config.ts index a7cdb01..5e504d2 100644 --- a/rollup.config.ts +++ b/rollup.config.ts @@ -1,14 +1,23 @@ import type { RollupOptions } from '@rollup' +import commonjs from '@rollup/plugin-commonjs' import dts from 'rollup-plugin-dts' import { terser } from 'rollup-plugin-terser' import typescript from 'rollup-plugin-typescript2' -import commonjs from '@rollup/plugin-commonjs' const pkg = require('./package.json') const name = 'bdcontract' export default [ + { + input: 'node_modules/@lifeomic/axios-fetch/src/index.js', + output: { + file: 'dist/axios-fetch.iife.js', + format: 'iife', + name: 'axiosFetch', + }, + plugins: [commonjs()], + }, { input: 'src/index.ts', output: [ @@ -17,12 +26,12 @@ export default [ format: 'umd', name, sourcemap: true, - globals:{ - "@daotl/cryptico":"cryptico", - "@lifeomic/axios-fetch":"axiosFetch", - "axios":"axios", - "sm-crypto":"smCrypto" - } + globals: { + '@daotl/cryptico': 'cryptico', + '@lifeomic/axios-fetch': 'axiosFetch', + axios: 'axios', + 'sm-crypto': 'smCrypto', + }, }, { file: `${pkg.module}`, format: 'es', sourcemap: true }, { @@ -30,12 +39,12 @@ export default [ format: 'iife', name, sourcemap: true, - globals:{ - "@daotl/cryptico":"cryptico", - "@lifeomic/axios-fetch":"axiosFetch", - "axios":"axios", - "sm-crypto":"smCrypto" - } + globals: { + '@daotl/cryptico': 'cryptico', + '@lifeomic/axios-fetch': 'axiosFetch', + axios: 'axios', + 'sm-crypto': 'smCrypto', + }, }, ], plugins: [ @@ -43,7 +52,8 @@ export default [ tsconfig: 'tsconfig.build.json', useTsconfigDeclarationDir: true, }), - terser(),commonjs() + terser(), + commonjs(), ], }, { diff --git a/test/http.html b/test/http.html index 24a73f0..1d94c32 100644 --- a/test/http.html +++ b/test/http.html @@ -1,110 +1,115 @@ -
- - - - - - - --> + + + + + + + - - -