Import .sol files like TypeScript
The Tevm bundler compiles Solidity on demand inside Vite, Rollup, esbuild, webpack, Rspack, and Bun — and hands you back a fully typed contract object. No codegen step, no artifacts directory, no stale ABI JSON.
Import a Solidity file the same way you import a TypeScript module, and get a fully typed contract object back.
import { Counter } from './contracts/Counter.sol'
Counter.abi
Counter.humanReadableAbi
Counter.deployedBytecodeThere is no code generation step to run, no artifacts/ directory to check in,
and no hand-written ABI constant that silently drifts from the contract it is
supposed to describe. Your build tool compiles Counter.sol on demand, caches
the result, and hands your application a Contract object with types derived
from the real ABI.
Why this exists
Every JavaScript project that talks to a smart contract has to answer the same question: how does the ABI get from Solidity into TypeScript? The usual answers are all unsatisfying.
- Copy the ABI into a
.jsonor.tsfile. It works until someone changes the contract and forgets the copy. The type checker cannot help you, because as far as it knows the stale ABI is the truth. - Run a codegen CLI in a pretest/prebuild hook. Now the generated files are either committed (noisy diffs, merge conflicts) or not committed (a broken checkout until someone runs the right command).
- Load the ABI at runtime. You lose every type, and you find out about a renamed function in production.
The Tevm bundler removes the question. The Solidity file is the module. The
import graph your bundler already walks is the same graph that tells it when to
recompile, so a change to Counter.sol invalidates exactly the modules that
depend on it — no more, no less.
What is in this repository
This repository is the whole Solidity-to-JavaScript pipeline:
- Bundler plugins for Vite, Rollup, esbuild, webpack, Rspack, Bun and RequireJS — thin adapters over one shared core.
- The compiler pipeline —
@tevm/config,@tevm/resolutions,@tevm/compiler,@tevm/solc,@tevm/runtime,@tevm/bundler-cacheand@tevm/base-bundler. - Editor tooling — the
@tevm/ts-pluginTypeScript language service plugin, the@tevm/lsplanguage server, and the Tevm VS Code extension. They share the resolution and compilation code with the bundlers, so the editor and the build agree about what a.solimport means. @tevm/effect— the small Effect-based helpers the rest of the pipeline is built on.
See Ecosystem & repo layout for how this repository relates to
tevm core and the other split repositories.
Get started
npm install --save-dev @tevm/vite-plugin @tevm/ts-pluginimport { vitePluginTevm } from '@tevm/vite-plugin'
import { defineConfig } from 'vite'
export default defineConfig({
plugins: [vitePluginTevm()],
})Head to Getting started for the complete walkthrough,
including the TypeScript setup that makes your editor understand .sol imports.
The Tevm family
This site is one of the *.tevm.sh docs sites — jump between them:

