postcss-load-config
Advanced tools
Comparing version 5.0.3 to 5.1.0
{ | ||
"name": "postcss-load-config", | ||
"version": "5.0.3", | ||
"version": "5.1.0", | ||
"description": "Autoload Config for PostCSS", | ||
@@ -24,8 +24,9 @@ "main": "src/index.js", | ||
"dependencies": { | ||
"lilconfig": "^3.0.0", | ||
"yaml": "^2.3.4" | ||
"lilconfig": "^3.1.1", | ||
"yaml": "^2.4.2" | ||
}, | ||
"peerDependencies": { | ||
"jiti": ">=1.21.0", | ||
"postcss": ">=8.0.9" | ||
"postcss": ">=8.0.9", | ||
"tsx": "^4.8.1" | ||
}, | ||
@@ -38,2 +39,5 @@ "peerDependenciesMeta": { | ||
"optional": true | ||
}, | ||
"tsx": { | ||
"optional": true | ||
} | ||
@@ -40,0 +44,0 @@ }, |
@@ -103,2 +103,5 @@ | ||
> [!NOTE] | ||
> For TypeScript configs, you must have [tsx](https://www.npmjs.com/package/tsx) or [jiti](https://www.npmjs.com/package/jiti) installed as a peer dependency. | ||
``` | ||
@@ -105,0 +108,0 @@ Project (Root) |
@@ -5,7 +5,10 @@ // @ts-check | ||
const TS_EXT_RE = /\.(c|m)?ts$/ | ||
const TS_EXT_RE = /\.[mc]?ts$/ | ||
/** @type {import('jiti').default | null} */ | ||
let jiti = null | ||
let tsx | ||
let jiti | ||
let importError | ||
/** | ||
@@ -26,16 +29,33 @@ * @param {string} name | ||
} | ||
if (!jiti) { | ||
try { | ||
jiti = (await import('jiti')).default | ||
} catch (jitiErr) { | ||
throw new Error( | ||
`'jiti' is required for the TypeScript configuration files. Make sure it is installed\nError: ${jitiErr.message}` | ||
) | ||
} | ||
if (tsx === undefined) { | ||
tsx = await import('tsx/cjs/api').catch(error => { | ||
importError = error | ||
}) | ||
} | ||
if (tsx) { | ||
let loaded = tsx.require(name, rootFile) | ||
return loaded && '__esModule' in loaded ? loaded.default : loaded | ||
} | ||
if (jiti === undefined) { | ||
jiti = await import('jiti').then( | ||
m => m.default, | ||
error => { | ||
importError = importError ?? error | ||
} | ||
/* c8 ignore stop */ | ||
} | ||
) | ||
} | ||
if (jiti) { | ||
return jiti(rootFile, { interopDefault: true })(name) | ||
} | ||
throw new Error( | ||
`'tsx' or 'jiti' is required for the TypeScript configuration files. Make sure it is installed\nError: ${importError.message}` | ||
) | ||
} | ||
module.exports = req |
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
22221
373
472
5
+ Added@esbuild/aix-ppc64@0.23.1(transitive)
+ Added@esbuild/android-arm@0.23.1(transitive)
+ Added@esbuild/android-arm64@0.23.1(transitive)
+ Added@esbuild/android-x64@0.23.1(transitive)
+ Added@esbuild/darwin-arm64@0.23.1(transitive)
+ Added@esbuild/darwin-x64@0.23.1(transitive)
+ Added@esbuild/freebsd-arm64@0.23.1(transitive)
+ Added@esbuild/freebsd-x64@0.23.1(transitive)
+ Added@esbuild/linux-arm@0.23.1(transitive)
+ Added@esbuild/linux-arm64@0.23.1(transitive)
+ Added@esbuild/linux-ia32@0.23.1(transitive)
+ Added@esbuild/linux-loong64@0.23.1(transitive)
+ Added@esbuild/linux-mips64el@0.23.1(transitive)
+ Added@esbuild/linux-ppc64@0.23.1(transitive)
+ Added@esbuild/linux-riscv64@0.23.1(transitive)
+ Added@esbuild/linux-s390x@0.23.1(transitive)
+ Added@esbuild/linux-x64@0.23.1(transitive)
+ Added@esbuild/netbsd-x64@0.23.1(transitive)
+ Added@esbuild/openbsd-arm64@0.23.1(transitive)
+ Added@esbuild/openbsd-x64@0.23.1(transitive)
+ Added@esbuild/sunos-x64@0.23.1(transitive)
+ Added@esbuild/win32-arm64@0.23.1(transitive)
+ Added@esbuild/win32-ia32@0.23.1(transitive)
+ Added@esbuild/win32-x64@0.23.1(transitive)
+ Addedesbuild@0.23.1(transitive)
+ Addedfsevents@2.3.3(transitive)
+ Addedget-tsconfig@4.8.1(transitive)
+ Addedresolve-pkg-maps@1.0.0(transitive)
+ Addedtsx@4.19.2(transitive)
Updatedlilconfig@^3.1.1
Updatedyaml@^2.4.2