Comparing version 4.0.0-beta.1 to 4.0.0-beta.2
@@ -7,3 +7,3 @@ "use strict"; | ||
if (process.platform === `win32`) { | ||
jsAfterCachePath = tsPath.substring(0, 1) + tsPath.substring(2, tsPath.length); | ||
jsAfterCachePath = tsPath.split(`:`)[1]; | ||
} | ||
@@ -10,0 +10,0 @@ return jsAfterCachePath; |
@@ -7,15 +7,19 @@ "use strict"; | ||
const options_defaults_1 = require("options-defaults"); | ||
const getDefaultCompilerOptions = () => { | ||
const defaultsForPlatform = { | ||
outDir: path.resolve(__dirname, `..`, `..`, `..`, `cache`), | ||
}; | ||
if (process.platform === `win32`) { | ||
const driveLetter = process.cwd().charAt(0); | ||
defaultsForPlatform.outDir = path.join(defaultsForPlatform.outDir, driveLetter); | ||
defaultsForPlatform.rootDir = `${driveLetter}:/`; | ||
} | ||
else { | ||
defaultsForPlatform.rootDir = `/`; | ||
} | ||
return defaultsForPlatform; | ||
}; | ||
const getConfig = (options) => { | ||
const defaultCompileOptions = { | ||
compilerOptions: { | ||
outDir: path.resolve(__dirname, `..`, `..`, `..`, `cache`), | ||
downlevelIteration: true, | ||
emitDecoratorMetadata: true, | ||
experimentalDecorators: true, | ||
module: tsc.ModuleKind.CommonJS, | ||
resolveJsonModule: true, | ||
rootDir: `/`, | ||
skipLibCheck: true, | ||
target: tsc.ScriptTarget.ES2015, | ||
}, | ||
compilerOptions: Object.assign(Object.assign({}, getDefaultCompilerOptions()), { downlevelIteration: true, emitDecoratorMetadata: true, experimentalDecorators: true, module: tsc.ModuleKind.CommonJS, resolveJsonModule: true, skipLibCheck: true, target: tsc.ScriptTarget.ES2015 }), | ||
}; | ||
@@ -22,0 +26,0 @@ const compileOptions = (0, options_defaults_1.defaults)(defaultCompileOptions, options); |
@@ -13,2 +13,6 @@ "use strict"; | ||
}; | ||
if (process.platform === `win32`) { | ||
const driveLetter = process.cwd().charAt(0); | ||
defaultTranspileOptions.cache.dir = path.join(defaultTranspileOptions.cache.dir, driveLetter); | ||
} | ||
const transpileOptions = (0, options_defaults_1.defaults)(defaultTranspileOptions, options); | ||
@@ -15,0 +19,0 @@ return transpileOptions; |
{ | ||
"name": "ts-import", | ||
"version": "4.0.0-beta.1", | ||
"version": "4.0.0-beta.2", | ||
"description": "Import (compile and cache on the fly) TypeScript files dynamically with ease.", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
57515
378