From: Jérôme Benoit Date: Tue, 30 May 2023 19:30:02 +0000 (+0200) Subject: fix: fix commonjs import issue with node.js 16.x.x X-Git-Tag: v1.2.15~3 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=f31d1d0c5175efb4d1f0ca6c0d9c228f920aba28;p=e-mobility-charging-stations-simulator.git fix: fix commonjs import issue with node.js 16.x.x Close #582 Signed-off-by: Jérôme Benoit --- diff --git a/rollup.config.mjs b/rollup.config.mjs index 2e1e811a..1034ffc8 100644 --- a/rollup.config.mjs +++ b/rollup.config.mjs @@ -32,7 +32,8 @@ export default { 'http-status-codes', 'just-clone', 'just-merge', - 'mnemonist', + 'mnemonist/lru-map-with-delete.js', + 'mnemonist/queue.js', 'moment', 'mongodb', 'node:async_hooks', diff --git a/src/charging-station/SharedLRUCache.ts b/src/charging-station/SharedLRUCache.ts index 0d7a9dcc..ba0a47d5 100644 --- a/src/charging-station/SharedLRUCache.ts +++ b/src/charging-station/SharedLRUCache.ts @@ -1,4 +1,4 @@ -import { LRUMapWithDelete as LRUCache } from 'mnemonist'; +import LRUCache from 'mnemonist/lru-map-with-delete.js'; import { Bootstrap } from './Bootstrap'; import type { ChargingStationConfiguration, ChargingStationTemplate } from '../types'; diff --git a/src/utils/AsyncLock.ts b/src/utils/AsyncLock.ts index 6b16b0f8..16ad4f2b 100644 --- a/src/utils/AsyncLock.ts +++ b/src/utils/AsyncLock.ts @@ -1,6 +1,6 @@ // Partial Copyright Jerome Benoit. 2021-2023. All Rights Reserved. -import { Queue } from 'mnemonist'; +import Queue from 'mnemonist/queue.js'; export enum AsyncLockType { configuration = 'configuration',