Files
revive/js/resolc
PG Herveou 45b6a57cae Fix npm package resolution (#339)
Current approach fails with an 'ERR_PACKAGE_PATH_NOT_EXPORTED' error for
npm package that defines an exports field in the package.json

e.g:
> require.resolve('@redstone-finance/evm-connector/package.json')
will fail with
Uncaught:
Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './package.json'
is not defined by "exports" in
/home/pg/github/evm-test-suite/eth-rpc/node_modules/@redstone-finance/evm-connector/package.json
  code: 'ERR_PACKAGE_PATH_NOT_EXPORTED'
2025-06-02 14:41:06 +02:00
..
2025-06-02 14:41:06 +02:00
2025-06-02 14:41:06 +02:00

Usage from Node.js

import { compile } from "@parity/resolc";
const sources = {
["contracts/1_Storage.sol"]: {
    content: readFileSync("fixtures/storage.sol", "utf8"),
}

const out = await compile(sources);

Usage from shell

 npx @parity/resolc@latest --bin contracts/1_Storage.sol