fix(core): update

This commit is contained in:
Philipp Kunz 2018-12-06 00:21:20 +01:00
parent 2582710e8f
commit 3897e15a7e
2 changed files with 13 additions and 1 deletions

6
dist/index.js vendored
View File

@ -11,6 +11,10 @@ const defaultTsNodeOptions = {
skipIgnore: true, skipIgnore: true,
cacheDirectory: path.join(__dirname, '../tscache') cacheDirectory: path.join(__dirname, '../tscache')
}; };
if (process.argv.includes('--web')) {
const previousCompilerOptions = defaultTsNodeOptions.compilerOptions;
defaultTsNodeOptions.compilerOptions = Object.assign({}, previousCompilerOptions, { lib: [previousCompilerOptions.lib, 'dom'] });
}
if (process.argv.includes('--nocache')) { if (process.argv.includes('--nocache')) {
defaultTsNodeOptions.cache = false; defaultTsNodeOptions.cache = false;
} }
@ -23,4 +27,4 @@ if (process.env.CLI_CALL_TSRUN) {
const pathToLoad = path.join(process.cwd(), pathToTsFile); const pathToLoad = path.join(process.cwd(), pathToTsFile);
Promise.resolve().then(() => require(pathToLoad)); Promise.resolve().then(() => require(pathToLoad));
} }
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi90cy9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOztBQUFBLDZCQUE2QjtBQUM3QixrQ0FBa0M7QUFHbEMsTUFBTSxvQkFBb0IsR0FBbUI7SUFDM0MsZUFBZSxFQUFtQjtRQUNoQyxHQUFHLEVBQUUsQ0FBQyxRQUFRLEVBQUUsUUFBUSxDQUFDO1FBQ3pCLE1BQU0sRUFBTyxRQUFRO1FBQ3JCLHNCQUFzQixFQUFFLElBQUk7S0FDN0I7SUFDRCxVQUFVLEVBQUUsSUFBSTtJQUNoQixjQUFjLEVBQUUsSUFBSSxDQUFDLElBQUksQ0FBQyxTQUFTLEVBQUUsWUFBWSxDQUFDO0NBQ25ELENBQUM7QUFFRixJQUFJLE9BQU8sQ0FBQyxJQUFJLENB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U0sdUJBQXVCLEdBQUcsb0JBQW9CLENBQUMsZUFBa0MsQ0FBQztJQUN4RixvQkFBb0IsQ0FBQyxlQUFlLHFCQUMvQix1QkFBdUIsSUFDMUIsR0FBRyxFQUFFLENBQUMsdUJBQXVCLENBQUMsR0FBRyxFQUFFLEtBQUssQ0FBQyxHQUMxQyxDQUFBO0NBQ0Y7QUFFRCxJQUFJLE9BQU8sQ0FBQyxJQUFJLENBQUMsUUFBUSxDQUFDLFdBQVcsQ0FBQyxFQUFFO0lBQ3RDLG9CQUFvQixDQUFDLEtBQUssR0FBRyxLQUFLLENBQUM7Q0FDcEM7QUFFRCxNQUFNLENBQUMsUUFBUSxDQUFDLG9CQUFvQixDQUFDLENBQUM7QUFFdEMsSUFBSSxPQUFPLENBQUMsR0FBRyxDQUFDLGNBQWMsRUFBRTtJQUM5Qix5QkFBeUI7SUFDekIscUNBQXFDO0lBQ3JDLHNDQUFzQztJQUN0QyxNQUFNLFlBQVksR0FBRyxPQUFPLENBQUMsSUFBSSxDQUFDLENBQUMsQ0FBQyxDQUFDO0lBRXJDLE1BQU0sVUFBVSxHQUFHLElBQUksQ0FBQyxJQUFJLENBQUMsT0FBTyxDQUFDLEdBQUcsRUFBRSxFQUFFLFlBQVksQ0FBQyxDQUFDO0lBQzFELHFDQUFPLFVBQVUsR0FBRTtDQUNwQiJ9

View File

@ -12,6 +12,14 @@ const defaultTsNodeOptions: tsNode.Options = {
cacheDirectory: path.join(__dirname, '../tscache') cacheDirectory: path.join(__dirname, '../tscache')
}; };
if (process.argv.includes('--web')) {
const previousCompilerOptions = defaultTsNodeOptions.compilerOptions as CompilerOptions;
defaultTsNodeOptions.compilerOptions = {
...previousCompilerOptions,
lib: [previousCompilerOptions.lib, 'dom']
}
}
if (process.argv.includes('--nocache')) { if (process.argv.includes('--nocache')) {
defaultTsNodeOptions.cache = false; defaultTsNodeOptions.cache = false;
} }