From 0dcc4dd13c43b096d6a6f86de692774b16d2c706 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20Birm=C3=A9?= Date: Thu, 3 Mar 2022 15:43:59 +0100 Subject: [PATCH] fix: a more safe way of including epas package version (#13) --- src/utils/constants.ts | 4 ++-- tsconfig.json | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/utils/constants.ts b/src/utils/constants.ts index d69730e..43e0b39 100644 --- a/src/utils/constants.ts +++ b/src/utils/constants.ts @@ -18,5 +18,5 @@ export enum EPASEvents { export const HEARTBEAT_INTERVAL = 30000; -const { version } = require("../../node_modules/@eyevinn/player-analytics-specification/package.json"); -export const EPAS_VERSION = version; \ No newline at end of file +import packageJson from "@eyevinn/player-analytics-specification/package.json"; +export const EPAS_VERSION = packageJson.version; \ No newline at end of file diff --git a/tsconfig.json b/tsconfig.json index 2f3936c..25173d8 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -7,7 +7,8 @@ "target": "es5", "declaration": true, "declarationDir": "./dist", - "emitDeclarationOnly": true + "emitDeclarationOnly": true, + "resolveJsonModule": true }, "exclude": ["node_modules", "demo", "dist"] }