@istanbuljs/esm-loader-hook
Advanced tools
Comparing version 0.1.0 to 0.1.1
16
index.js
@@ -11,8 +11,6 @@ import {fileURLToPath} from 'url'; | ||
} catch { | ||
return null; | ||
} | ||
} | ||
const initialCWD = process.env.NYC_CWD || process.cwd(); | ||
let nycConfig = nycEnvironmentConfig(); | ||
let nycConfig; | ||
let testExclude; | ||
@@ -22,6 +20,12 @@ let babelConfig; | ||
export async function transformSource(source, context) { | ||
if (nycConfig === null) { | ||
nycConfig = { | ||
if (loader.isLoading()) { | ||
return {source}; | ||
} | ||
if (!nycConfig) { | ||
nycConfig = nycEnvironmentConfig() || { | ||
...schema.defaults.nyc, | ||
...await loader.loadNycConfig({cwd: initialCWD}) | ||
...await loader.loadNycConfig({ | ||
cwd: process.env.NYC_CWD || process.cwd() | ||
}) | ||
}; | ||
@@ -28,0 +32,0 @@ } |
{ | ||
"name": "@istanbuljs/esm-loader-hook", | ||
"version": "0.1.0", | ||
"version": "0.1.1", | ||
"description": "Loader hook for ESM instrumentation (experimental!!)", | ||
@@ -30,3 +30,3 @@ "type": "module", | ||
"@babel/core": "^7.8.7", | ||
"@istanbuljs/load-nyc-config": "^1.0.0", | ||
"@istanbuljs/load-nyc-config": "^1.1.0", | ||
"@istanbuljs/schema": "^0.1.2", | ||
@@ -33,0 +33,0 @@ "babel-plugin-istanbul": "^6.0.0", |
@@ -42,9 +42,2 @@ # @istanbuljs/esm-loader-hook | ||
## `@istanbuljs/esm-loader-hook` for enterprise | ||
Available as part of the Tidelift Subscription. | ||
The maintainers of `@istanbuljs/esm-loader-hook` and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. [Learn more.](https://tidelift.com/subscription/pkg/npm-istanbuljs-esm-loader-hook?utm_source=npm-istanbuljs-esm-loader-hook&utm_medium=referral&utm_campaign=enterprise) | ||
[tests-status]: https://github.com/cfware/node-preload/workflows/Tests/badge.svg | ||
@@ -51,0 +44,0 @@ [npm-image]: https://img.shields.io/npm/v/@istanbuljs/esm-loader-hook.svg |
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
5
66
6342
51