From cb5574a5f44826570df6c407669cc7bad76e198a Mon Sep 17 00:00:00 2001 From: ahonn Date: Wed, 18 Sep 2024 12:39:59 +1000 Subject: [PATCH] build: add "esModuleInterop": true to fix import issue (#171) --- backend/src/decorators/plimit.decorator.ts | 2 +- backend/src/modules/rgbpp/statistic/statistic.service.ts | 2 +- backend/tsconfig.json | 5 ++++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/backend/src/decorators/plimit.decorator.ts b/backend/src/decorators/plimit.decorator.ts index 27c3cee3..49b2f930 100644 --- a/backend/src/decorators/plimit.decorator.ts +++ b/backend/src/decorators/plimit.decorator.ts @@ -1,4 +1,4 @@ -import * as pLimit from 'p-limit'; +import pLimit from 'p-limit'; export interface PLimitOptions { concurrency: number; diff --git a/backend/src/modules/rgbpp/statistic/statistic.service.ts b/backend/src/modules/rgbpp/statistic/statistic.service.ts index f5c1cbda..8b8dc404 100644 --- a/backend/src/modules/rgbpp/statistic/statistic.service.ts +++ b/backend/src/modules/rgbpp/statistic/statistic.service.ts @@ -2,7 +2,7 @@ import { Inject, Injectable, Logger } from '@nestjs/common'; import { CACHE_MANAGER, Cache } from '@nestjs/cache-manager'; import { ONE_DAY_MS } from 'src/common/date'; import { CkbRpcWebsocketService } from 'src/core/ckb-rpc/ckb-rpc-websocket.service'; -import * as pLimit from 'p-limit'; +import pLimit from 'p-limit'; import { BI } from '@ckb-lumos/bi'; import { CkbScriptService } from 'src/modules/ckb/script/script.service'; import { CellType } from 'src/modules/ckb/script/script.model'; diff --git a/backend/tsconfig.json b/backend/tsconfig.json index f93fcd7e..ace46108 100644 --- a/backend/tsconfig.json +++ b/backend/tsconfig.json @@ -5,6 +5,7 @@ "removeComments": true, "emitDecoratorMetadata": true, "experimentalDecorators": true, + "esModuleInterop": true, "allowSyntheticDefaultImports": true, "resolveJsonModule": true, "target": "ES2021", @@ -19,5 +20,7 @@ "forceConsistentCasingInFileNames": false, "noFallthroughCasesInSwitch": false }, - "exclude": ["dist"] + "exclude": [ + "dist" + ] }