Skip to content

Commit 08290f0

Browse files
authored
refactor: reduce build size (#441)
* refactor: reduce build size * chore: resolve tsc
1 parent 23d0b92 commit 08290f0

File tree

5 files changed

+13
-4
lines changed

5 files changed

+13
-4
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
"docker:deno": "docker compose -f ./test/docker/playground/deno/docker-compose.yml up --build",
2626
"clear": "shx rm -rf ./lib ./ci ./coverage",
2727
"prebuild": "npm run clear",
28-
"build": "tsc && tsc -p tsconfig.test.json",
28+
"build": "tsc && shx rm -rf ./lib/@types && tsc -p tsconfig.types.json && tsc -p tsconfig.test.json",
2929
"postbuild": "tsx ./tools/compatibility/node.ts && shx cp fixtures/server/package.json ci/fixtures/server/package.json && npm run build:deno && shx chmod +x lib/bin/index.js",
3030
"build:deno": "esbuild src/polyfills/deno.mts --outfile=lib/polyfills/deno.mjs --format=esm",
3131
"eslint:checker": "eslint . --ext .js,.ts",

src/modules/assert-promise.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* c8 ignore next */
22
import type { ParseAssertionOptions } from '../@types/assert.js';
3-
import nodeAssert from 'node:assert';
3+
import * as nodeAssert from 'node:assert';
44
import { parseAssertion } from '../helpers/parse-assertion.js';
55
import { nodeVersion } from '../helpers/get-runtime.js';
66

src/modules/assert.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* c8 ignore next */
22
import type { ParseAssertionOptions } from '../@types/assert.js';
3-
import nodeAssert from 'node:assert';
3+
import * as nodeAssert from 'node:assert';
44
import { parseAssertion } from '../helpers/parse-assertion.js';
55
import { nodeVersion } from '../helpers/get-runtime.js';
66

tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"include": ["src"],
3-
"exclude": ["test", "tools"],
3+
"exclude": ["test", "tools", "src/@types"],
44
"compilerOptions": {
55
"target": "ES2015",
66
"lib": ["ES2015"],

tsconfig.types.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"extends": "./tsconfig.json",
3+
"include": ["src/@types"],
4+
"exclude": ["test", "tools"],
5+
"compilerOptions": {
6+
"outDir": "lib/@types",
7+
"emitDeclarationOnly": true
8+
}
9+
}

0 commit comments

Comments
 (0)