diff --git a/package.json b/package.json index 0fe2c9c..bcd7344 100644 --- a/package.json +++ b/package.json @@ -15,7 +15,7 @@ "nocov": "ts-mocha test/**/*.spec.ts", "test": "nyc ts-mocha test/**/*.spec.ts && tsd", "coverage": "nyc --report html ts-mocha test/**/*.spec.ts && open coverage/index.html", - "build": "tsup src/index.ts --format esm,cjs --dts" + "build": "tsup" }, "repository": { "type": "git", diff --git a/src/index.ts b/src/index.ts index 4f9737b..a3b93bd 100644 --- a/src/index.ts +++ b/src/index.ts @@ -11,11 +11,10 @@ import type { SinonExpectation, SinonSpy, SinonStubbedInstance } from 'sinon'; import sinon from 'sinon'; import traverse from 'traverse'; +import { Readable } from 'stream'; import AWS_SDK from 'aws-sdk'; -import { Readable } from 'stream'; - import { type ReplaceFn, type ClientName, @@ -531,4 +530,4 @@ function restoreMethod>(service: C } })(); -export default AWS; +export = AWS; diff --git a/src/types.ts b/src/types.ts index a3eb315..c5bf14a 100644 --- a/src/types.ts +++ b/src/types.ts @@ -1,5 +1,5 @@ import { type Request, type AWSError } from 'aws-sdk/lib/core.js'; -import AWS = require('aws-sdk/clients/all'); +import AWS from 'aws-sdk/clients/all'; import {type SinonStub } from 'sinon'; /* diff --git a/tsup.config.ts b/tsup.config.ts new file mode 100644 index 0000000..c0721fa --- /dev/null +++ b/tsup.config.ts @@ -0,0 +1,10 @@ +import { defineConfig } from 'tsup'; + +export default defineConfig({ + format: ['cjs', 'esm'], + entry: ['src/index.ts'], + dts: true, + shims: true, + skipNodeModulesBundle: true, + clean: true, +}) \ No newline at end of file