Skip to content

Commit 2dfc542

Browse files
chore: enabled json imports (#30223)
1 parent 4b50202 commit 2dfc542

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

lib/expose.cjs

+4-2
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,11 @@
22

33
/**
44
* returns renovates package.json
5-
* @type {import('./types').RenovatePackageJson}
65
*/
7-
const pkg = (() => require('../package.json'))();
6+
const path = (() => require('path'))();
7+
// need to use dynamic strings so that typescript does not include package.json in dist folder after compilation
8+
const filePath = path.join(__dirname, '..', 'package.json');
9+
const pkg = (() => require(filePath))();
810

911
/**
1012
* return's re2

tsconfig.app.json

-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
"extends": "./tsconfig",
33
"compilerOptions": {
44
"declaration": true,
5-
"resolveJsonModule": false,
65
"sourceMap": true,
76
"inlineSources": true,
87
"importHelpers": true,

tsconfig.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"sourceMap": true,
1111
"allowSyntheticDefaultImports": true,
1212
"esModuleInterop": true,
13-
"resolveJsonModule": false,
13+
"resolveJsonModule": true,
1414
"noUnusedLocals": true,
1515
"noImplicitOverride": true,
1616
"experimentalDecorators": true,

0 commit comments

Comments
 (0)