fix(api): require package.json directly so typescript doesnt compile it into dist folder

pull/304/head
sct 4 years ago
parent 3f2a04c881
commit b9faa6486b

@ -17,7 +17,6 @@ import { scheduledJobs } from '../job/schedule';
import { Permission } from '../lib/permissions'; import { Permission } from '../lib/permissions';
import { isAuthenticated } from '../middleware/auth'; import { isAuthenticated } from '../middleware/auth';
import { merge } from 'lodash'; import { merge } from 'lodash';
import { version } from '../../package.json';
import Media from '../entity/Media'; import Media from '../entity/Media';
import { MediaRequest } from '../entity/MediaRequest'; import { MediaRequest } from '../entity/MediaRequest';
@ -441,6 +440,9 @@ settingsRoutes.get('/about', async (req, res) => {
const totalMediaItems = await mediaRepository.count(); const totalMediaItems = await mediaRepository.count();
const totalRequests = await mediaRequestRepository.count(); const totalRequests = await mediaRequestRepository.count();
// eslint-disable-next-line @typescript-eslint/no-var-requires
const { version } = require('../../package.json');
let finalVersion = version; let finalVersion = version;
if (version === '0.1.0') { if (version === '0.1.0') {

Loading…
Cancel
Save