resolve json modules

This commit is contained in:
Jip Sterk 2020-10-20 00:55:14 +02:00
parent 03c154c463
commit a0489be563
No known key found for this signature in database
GPG key ID: ABD726A636C0BAFF
3 changed files with 6 additions and 5 deletions

View file

@ -1,20 +1,19 @@
const appPackage: Record<string, string> = require('./package.json')
import { bundleID, companyName, productName, version } from './package.json'
export function getProductName() {
const productName = appPackage.productName
return process.env.NODE_ENV === 'development'
? `${productName}-dev`
: productName
}
export function getCompanyName() {
return appPackage.companyName
return companyName
}
export function getVersion() {
return appPackage.version
return version
}
export function getBundleID() {
return appPackage.bundleID
return bundleID
}

View file

@ -3,6 +3,7 @@
"module": "commonjs",
"moduleResolution": "node",
"esModuleInterop": true,
"resolveJsonModule": true,
"importHelpers": true,
"target": "es2017",
"allowUnreachableCode": false,

View file

@ -4,6 +4,7 @@
"moduleResolution": "node",
"target": "es2017",
"esModuleInterop": true,
"resolveJsonModule": true,
"importHelpers": true,
"allowUnreachableCode": false,
"allowUnusedLabels": false,