specify the working-directory where your npm
command should be invoked,
so that your package will get installed to ${dir}/node_modules/
.
note that a trailing slash is always added to dir
if it's missing it, and you can also provide a non-normalized path,
or relative paths with respect to esbuild's absWorkingDir
(which fallbacks to the runtime's current-working-directory if undefined
).
furthermore, you should not add this directory to the NpmPluginSetupConfig.nodeModulesDirs array,
because the plugin will add this dir
to the beginning of that array internally.
a function which should accept the package name-and-version string (such as "react@17 - 19"
),
and then return a cli command, that when executed, will install the npm-package to the ${dir}/node_modules/
folder.
note that you can technically change the directory where the command is executed using cd
,
however if you down a subdirectory (for instance cd ./temp/ && npm install "${package_name_and_version}" --no-save
),
then the installed package will not be discoverable by esbuild's node-resolution-algorithm, because it only traverses upwards.
thus, you may only navigate to ancestral directories (such as cd ../temp/ && npm install "${package_name_and_version}" --no-save
),
for the new package to be discoverable by esbuild.
Optional
logenable logging of the npm-package installation command, when DEBUG.LOG is ennabled.
these options let you precisely customize how and where your missing npm-packages should get installed.