From 403fb5f47750bc08534f7218ad55f8c3cb36d0a3 Mon Sep 17 00:00:00 2001 From: HungLV Date: Wed, 14 Aug 2024 10:33:40 +0700 Subject: [PATCH] fix: relative path to elastic search --- package.json | 2 ++ src/apis/index.ts | 2 +- src/jobs/elastic-search/elastic-search-job.ts | 2 +- tsconfig.json | 1 + 4 files changed, 5 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 881cf99..de5f777 100644 --- a/package.json +++ b/package.json @@ -5,6 +5,7 @@ "author": "HungLV", "license": "MIT", "private": true, + "type": "commonjs", "scripts": { "prepare": "husky", "clean": "rm -rf ./dist tsconfig.tsbuildinfo", @@ -66,6 +67,7 @@ "typescript-eslint": "^7.18.0" }, "imports": { + "#root/*": "./dist/*.js", "#apis/*": "./dist/apis/*.js", "#common/*": "./dist/common/*.js", "#configs/*": "./dist/configs/*.js", diff --git a/src/apis/index.ts b/src/apis/index.ts index 37e0628..57c94fc 100644 --- a/src/apis/index.ts +++ b/src/apis/index.ts @@ -13,7 +13,7 @@ import { loggerSetting, logger } from '#common/loggger'; import * as routes from './routes'; import { getAllQueues } from '#jobs/index'; import * as elasticSearchJob from '#jobs/elastic-search/elastic-search-job'; -import { initIndexes } from 'elastic-search/indexes'; +import { initIndexes } from '#root/elastic-search/indexes/index'; import { Prisma } from '@prisma/client'; import Boom from '@hapi/boom'; diff --git a/src/jobs/elastic-search/elastic-search-job.ts b/src/jobs/elastic-search/elastic-search-job.ts index 24dd399..857bdc1 100644 --- a/src/jobs/elastic-search/elastic-search-job.ts +++ b/src/jobs/elastic-search/elastic-search-job.ts @@ -1,6 +1,6 @@ import { redis } from '#common/redis'; import { Worker, Job, Queue } from 'bullmq'; -import * as productsIndex from 'elastic-search/indexes/products'; +import * as productsIndex from '#root/elastic-search/indexes/products/index'; const QUEUE_NAME = 'products-queue'; const JOB_NAME = 'products-job'; diff --git a/tsconfig.json b/tsconfig.json index 0a4f4d0..4be9ea6 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -14,6 +14,7 @@ "outDir": "dist", "baseUrl": "src", "paths": { + "#root/*": ["./*"], "#apis/*": ["apis/*"], "#common/*": ["common/*"], "#configs/*": ["configs/*"],