Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix tree shaking #661

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
25 changes: 22 additions & 3 deletions package.json
Expand Up @@ -5,9 +5,10 @@
"scripts": {
"bench": "vitest bench",
"bench:ci": "CI=true vitest bench",
"build": "pnpm run clean && pnpm run build:cjs && pnpm run build:esm && pnpm run build:types",
"build": "pnpm run clean && pnpm run build:cjs && pnpm run build:esm && pnpm run build:pure-annotations && pnpm run build:types",
"build:cjs": "tsc --project tsconfig.build.json --module commonjs --outDir ./dist/cjs --removeComments --verbatimModuleSyntax false && echo > ./dist/cjs/package.json '{\"type\":\"commonjs\"}'",
"build:esm": "tsc --project tsconfig.build.json --module es2015 --outDir ./dist/esm --removeComments && echo > ./dist/esm/package.json '{\"type\":\"module\"}'",
"build:esm": "tsc --project tsconfig.build.json --module es2015 --outDir ./dist/esm --removeComments && echo > ./dist/esm/package.json '{\"type\":\"module\",\"sideEffects\":false}'",
"build:pure-annotations": "babel --out-dir ./src -x .ts --out-file-extension=.ts --plugins=babel-plugin-annotate-pure-calls --plugins=@babel/plugin-syntax-typescript",
"build:types": "tsc --project tsconfig.build.json --module esnext --declarationDir ./dist/types --emitDeclarationOnly --declaration --declarationMap",
"changeset": "changeset",
"changeset:release": "pnpm build && changeset publish",
Expand Down Expand Up @@ -152,6 +153,9 @@
"devDependencies": {
"@actions/core": "^1.10.0",
"@actions/github": "^5.1.1",
"@babel/cli": "^7.21.5",
"@babel/core": "^7.22.1",
"@babel/plugin-syntax-typescript": "^7.22.5",
"@changesets/changelog-github": "^0.4.5",
"@changesets/cli": "^2.23.2",
"@size-limit/preset-big-lib": "^8.2.4",
Expand All @@ -161,6 +165,7 @@
"@vitest/coverage-c8": "^0.30.1",
"@vitest/ui": "^0.30.1",
"@wagmi/cli": "^0.1.6",
"babel-plugin-annotate-pure-calls": "^0.4.0",
"bun": "^0.5.9",
"ethers": "^5.7.2",
"ethers@6": "npm:ethers@^6.0.2",
Expand Down Expand Up @@ -194,7 +199,21 @@
],
"size-limit": [
{
"path": "./dist/cjs/index.js"
"name": "viem (cjs)",
"path": "./dist/cjs/index.js",
"limit": "60 kB"
},
{
"name": "viem (tree-shaking check)",
"path": "./dist/esm/index.js",
"limit": "1.5 kB",
"import": "{ defineBlock }"
},
{
"name": "viem/chains",
"path": "./dist/esm/chains.js",
"limit": "1 kB",
"import": "{ mainnet }"
}
],
"simple-git-hooks": {
Expand Down