diff --git a/package.json b/package.json index cc358123b..08fdf6ae2 100644 --- a/package.json +++ b/package.json @@ -19,18 +19,15 @@ "docs:build": "typedoc ./src && touch ./docs/.nojekyll" }, "dependencies": { - "@types/ws": "^7.4.7", "axios": "^0.21.1", "change-case": "^4.1.2", "eventemitter3": "^4.0.7", + "isomorphic-form-data": "^2.0.0", "isomorphic-ws": "^4.0.1", "normalize-url": "^7.0.1", "semver": "^7.3.5", "ws": "^8.2.1" }, - "peerDependencies": { - "isomorphic-form-data": "^2.0.0" - }, "devDependencies": { "@rollup/plugin-commonjs": "^20.0.0", "@rollup/plugin-json": "^4.1.0", @@ -39,6 +36,7 @@ "@types/jest": "^27.0.1", "@types/node": "^16.7.10", "@types/semver": "^7.3.8", + "@types/ws": "^7.4.7", "@typescript-eslint/eslint-plugin": "^4.29.2", "@typescript-eslint/parser": "^4.30.0", "codecov": "^3.8.3", @@ -48,7 +46,6 @@ "eslint-plugin-import": "^2.24.2", "eslint-plugin-prettier": "^4.0.0", "eslint-plugin-simple-import-sort": "^7.0.0", - "isomorphic-form-data": "^2.0.0", "jest": "^27.1.0", "npm-run-all": "^4.1.5", "prettier": "^2.3.2", diff --git a/rollup.config.js b/rollup.config.js index f3d2cf9d1..9be111026 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -1,29 +1,10 @@ import commonjs from '@rollup/plugin-commonjs'; import json from '@rollup/plugin-json'; +import autoExternal from 'rollup-plugin-auto-external'; import typescript from 'rollup-plugin-typescript2'; import packageJSON from './package.json'; -const external = [ - 'asynckit', - 'axios', - 'change-case', - 'combined-stream', - 'eventemitter3', - 'fs', - 'form-data', - 'http', - 'https', - 'isomorphic-ws', - 'mime-types', - 'normalize-url', - 'path', - 'querystring', - 'semver', - 'url', - 'util', -]; - export default [ { input: './src/index.ts', @@ -32,8 +13,7 @@ export default [ format: 'cjs', exports: 'named', }, - plugins: [commonjs(), json(), typescript()], - external, + plugins: [commonjs(), json(), typescript(), autoExternal()], }, { input: './src/index.ts', @@ -42,7 +22,6 @@ export default [ format: 'esm', exports: 'named', }, - plugins: [commonjs(), json(), typescript()], - external, + plugins: [commonjs(), json(), typescript(), autoExternal()], }, ]; diff --git a/src/serializers/serializer-impl.ts b/src/serializers/serializer-impl.ts index 7303058cf..d99ba7380 100644 --- a/src/serializers/serializer-impl.ts +++ b/src/serializers/serializer-impl.ts @@ -1,3 +1,5 @@ +import 'isomorphic-form-data'; + import { camelCase, snakeCase } from 'change-case'; import { ParsedUrlQuery, stringify } from 'querystring';