@chialab/esbuild-plugin-bundle-dependencies
Advanced tools
Comparing version 0.12.7 to 0.12.22
import { readFile } from 'fs/promises'; | ||
import pkgUp from 'pkg-up'; | ||
import { getRootDir } from '@chialab/esbuild-helpers'; | ||
@@ -23,4 +24,3 @@ /** | ||
async setup(build) { | ||
const options = build.initialOptions; | ||
const { sourceRoot, absWorkingDir, bundle } = options; | ||
const { bundle, external = [] } = build.initialOptions; | ||
if (!bundle) { | ||
@@ -30,8 +30,7 @@ return; | ||
const rootDir = sourceRoot || absWorkingDir || process.cwd(); | ||
const external = [...(options.external || [])]; | ||
const rootDir = getRootDir(build); | ||
const packageFile = await pkgUp({ | ||
cwd: rootDir, | ||
}); | ||
if (packageFile) { | ||
@@ -62,3 +61,3 @@ const packageJson = JSON.parse(await readFile(packageFile, 'utf-8')); | ||
options.external = external; | ||
build.initialOptions.external = external; | ||
}, | ||
@@ -65,0 +64,0 @@ }; |
{ | ||
"name": "@chialab/esbuild-plugin-bundle-dependencies", | ||
"type": "module", | ||
"version": "0.12.7", | ||
"version": "0.12.22", | ||
"description": "Collect or exclude module dependencies to bundle.", | ||
@@ -31,2 +31,3 @@ "main": "lib/index.js", | ||
"dependencies": { | ||
"@chialab/esbuild-helpers": "^0.12.22", | ||
"pkg-up": "^3.1.0" | ||
@@ -37,3 +38,3 @@ }, | ||
}, | ||
"gitHead": "3dea1f3e3e7ecb0c74e991ffbc6be2b93d0fb08c" | ||
"gitHead": "4f148caa35416d70db6201f1994f55c77a30c256" | ||
} |
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
5487
2
75
+ Added@chialab/esbuild-helpers@0.12.31(transitive)
+ Addedesbuild@0.13.15(transitive)
+ Addedesbuild-android-arm64@0.13.15(transitive)
+ Addedesbuild-darwin-64@0.13.15(transitive)
+ Addedesbuild-darwin-arm64@0.13.15(transitive)
+ Addedesbuild-freebsd-64@0.13.15(transitive)
+ Addedesbuild-freebsd-arm64@0.13.15(transitive)
+ Addedesbuild-linux-32@0.13.15(transitive)
+ Addedesbuild-linux-64@0.13.15(transitive)
+ Addedesbuild-linux-arm@0.13.15(transitive)
+ Addedesbuild-linux-arm64@0.13.15(transitive)
+ Addedesbuild-linux-mips64le@0.13.15(transitive)
+ Addedesbuild-linux-ppc64le@0.13.15(transitive)
+ Addedesbuild-netbsd-64@0.13.15(transitive)
+ Addedesbuild-openbsd-64@0.13.15(transitive)
+ Addedesbuild-sunos-64@0.13.15(transitive)
+ Addedesbuild-windows-32@0.13.15(transitive)
+ Addedesbuild-windows-64@0.13.15(transitive)
+ Addedesbuild-windows-arm64@0.13.15(transitive)