Comparing version 1.1.1-dev.20210905.5 to 1.1.1-dev.20210905.6
@@ -31,4 +31,21 @@ const fs = require('fs'); | ||
// Create TSC Hook API | ||
const ignoredConfigOptions = [ 'save', 'ignore', 'path', 'directory' ]; | ||
const api = { | ||
tsconfig: createTSConfigAPI(tsconfig, tsconfigPath) | ||
tsconfig: { | ||
...tsconfig, | ||
save: function() { | ||
const tsconfigCopy = { ...api.tsconfig }; | ||
for (const ignoredConfigOption of ignoredConfigOptions) { | ||
eval(`delete tsconfigCopy.${ignoredConfigOption}`); | ||
} | ||
fs.writeFileSync(tsconfigPath, JSON.stringify(tsconfigCopy, null, 2)); | ||
}, | ||
ignore: function(configOption) { | ||
ignoredConfigOptions.add(configOption); | ||
api.tsconfig.save(); | ||
}, | ||
path: tsconfigPath, | ||
directory: tsconfigDir | ||
} | ||
}; | ||
@@ -35,0 +52,0 @@ |
{ | ||
"name": "tsc-hooks", | ||
"version": "1.1.1-dev.20210905.5", | ||
"version": "1.1.1-dev.20210905.6", | ||
"description": "Add tsc compiler hooks to your TypeScript project", | ||
@@ -5,0 +5,0 @@ "main": "run.js", |
9
107236
14
135