Skip to content

Commit

Permalink
import json files directly
Browse files Browse the repository at this point in the history
with the help of typescript configuration "resolveJsonModule": true.
  • Loading branch information
2u6z3r0 committed Nov 29, 2020
1 parent 4cd80dc commit b53f483
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/templates/build.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import s from 'shelljs';
const config = require('./tsconfig.json');
import config from './tsconfig.json';
const outDir = config.compilerOptions.outDir;

s.rm('-rf', outDir);
Expand Down
3 changes: 2 additions & 1 deletion app/templates/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
"sourceMap": true,
"moduleResolution": "node",
"outDir": "dist",
"typeRoots": ["node_modules/@types"]
"typeRoots": ["node_modules/@types"],
"resolveJsonModule": true
},
"include": ["typings.d.ts", "server/**/*.ts"],
"exclude": ["node_modules"]
Expand Down

0 comments on commit b53f483

Please sign in to comment.