diff --git a/tools/push3-transpiler/src/index.ts b/tools/push3-transpiler/src/index.ts index f8d9423..654a83d 100644 --- a/tools/push3-transpiler/src/index.ts +++ b/tools/push3-transpiler/src/index.ts @@ -10,8 +10,8 @@ import * as fs from 'fs'; import * as path from 'path'; -import { parse } from './parser'; -import { transpile } from './transpiler'; +import { parse } from './parser.js'; +import { transpile } from './transpiler.js'; function main(): void { const args = process.argv.slice(2); diff --git a/tools/push3-transpiler/src/transpiler.ts b/tools/push3-transpiler/src/transpiler.ts index d6da0de..198561a 100644 --- a/tools/push3-transpiler/src/transpiler.ts +++ b/tools/push3-transpiler/src/transpiler.ts @@ -8,7 +8,7 @@ * Only the subset of instructions used in optimizer_v3.push3 is implemented. */ -import { Node } from './parser'; +import { Node } from './parser.js'; interface TranspilerState { dStack: string[]; // DYADIC stack (Solidity expressions) diff --git a/tools/push3-transpiler/tsconfig.json b/tools/push3-transpiler/tsconfig.json index f63bd2d..efe4d9d 100644 --- a/tools/push3-transpiler/tsconfig.json +++ b/tools/push3-transpiler/tsconfig.json @@ -1,8 +1,9 @@ { "compilerOptions": { - "target": "ES2020", - "module": "commonjs", - "lib": ["ES2020"], + "target": "ES2022", + "module": "NodeNext", + "moduleResolution": "NodeNext", + "lib": ["ES2022"], "outDir": "dist", "rootDir": "src", "strict": true, @@ -10,6 +11,9 @@ "skipLibCheck": true, "resolveJsonModule": true }, + "ts-node": { + "esm": true + }, "include": ["src/**/*"], "exclude": ["node_modules", "dist"] }