Comparing version 3.0.0-beta.0 to 3.0.0-beta.1
@@ -6,4 +6,6 @@ import * as tsc from 'typescript'; | ||
} | ||
export declare let defaultLoadOptions: LoadOptions; | ||
export declare let defaultLoadOptions: { | ||
transpileOptions: {}; | ||
}; | ||
export declare const load: (tsRelativePath: string, options?: Partial<LoadOptions> | undefined) => Promise<any>; | ||
export declare const loadSync: (tsRelativePath: string, options?: Partial<LoadOptions> | undefined) => any; |
@@ -5,2 +5,3 @@ "use strict"; | ||
const compiler = require("./modules/compiler"); | ||
const crossPlatform = require("./modules/cross-platform"); | ||
const path = require("path"); | ||
@@ -10,3 +11,2 @@ const utils = require("./utils"); | ||
exports.defaultLoadOptions = { | ||
cacheDir: path.resolve(__dirname, `../cache`), | ||
transpileOptions: {}, | ||
@@ -17,4 +17,6 @@ }; | ||
const cwd = process.cwd(); | ||
const cacheDir = path.resolve(__dirname, `..`, `cache`); | ||
const tsPath = path.resolve(cwd, tsRelativePath); | ||
const jsPath = path.join(config.cacheDir, tsPath).replace(/\.[^/.]+$/u, `.js`); | ||
let jsAfterCachePath = crossPlatform.getJsAfterCachePath(tsPath); | ||
const jsPath = path.join(cacheDir, jsAfterCachePath).replace(/\.[^/.]+$/u, `.js`); | ||
const [tsFileExists, jsFileExists] = await Promise.all([ | ||
@@ -41,4 +43,6 @@ utils.checkIfFileExists(tsPath), | ||
const cwd = process.cwd(); | ||
const cacheDir = path.resolve(__dirname, `..`, `cache`); | ||
const tsPath = path.resolve(cwd, tsRelativePath); | ||
const jsPath = path.join(config.cacheDir, tsPath).replace(/\.[^/.]+$/u, `.js`); | ||
let jsAfterCachePath = crossPlatform.getJsAfterCachePath(tsPath); | ||
const jsPath = path.join(cacheDir, jsAfterCachePath).replace(/\.[^/.]+$/u, `.js`); | ||
const tsFileExists = utils.checkIfFileExistsSync(tsPath); | ||
@@ -45,0 +49,0 @@ let jsFileExists; |
@@ -0,0 +0,0 @@ import * as tsc from 'typescript'; |
@@ -0,0 +0,0 @@ "use strict"; |
export * from './compile'; |
@@ -0,0 +0,0 @@ "use strict"; |
@@ -0,0 +0,0 @@ /// <reference types="node" /> |
@@ -0,0 +0,0 @@ "use strict"; |
export * from './check-if-file-exists'; | ||
export * from './is-file-newer'; |
@@ -0,0 +0,0 @@ "use strict"; |
import * as fs from 'fs'; | ||
export declare const isFileNewer: (file1: fs.Stats, file2: fs.Stats) => boolean; |
@@ -0,0 +0,0 @@ "use strict"; |
{ | ||
"name": "ts-import", | ||
"version": "3.0.0-beta.0", | ||
"version": "3.0.0-beta.1", | ||
"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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
40261
33
164
0