fix: fix commonjs import issue with node.js 16.x.x
authorJérôme Benoit <jerome.benoit@sap.com>
Tue, 30 May 2023 19:30:02 +0000 (21:30 +0200)
committerJérôme Benoit <jerome.benoit@sap.com>
Tue, 30 May 2023 19:30:02 +0000 (21:30 +0200)
Close #582

Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>
rollup.config.mjs
src/charging-station/SharedLRUCache.ts
src/utils/AsyncLock.ts

index 2e1e811a09393b99e20cb55de67f05daf394ddf5..1034ffc812825d1adcc7005ac13ce24f48b8f02d 100644 (file)
@@ -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',
index 0d7a9dccec5fc04fbe19c4cbba386151d3af0265..ba0a47d59b70962ab75517aab0215dda6b0b3424 100644 (file)
@@ -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';
index 6b16b0f8a491622a91c8eed844ba5f30bc70b02f..16ad4f2b1cdcf53b44a90f6b6970858cff789e28 100644 (file)
@@ -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',