[Feature request] Resolve module dependency given the directory configuration in the package.json #22463
Labels
duplicate
Issues and PRs that are duplicates of other issues or PRs.
feature request
Issues that request new features to be added to Node.js.
module
Issues and PRs related to the module subsystem.
The problem:
I have 2 projects in my application structure, I have a core library (
@components
) that is made in typescript and then compiled to plain-javascript in the build directory that exports an objectCustomTable
in the filebuild/CustomTable.js
In my another project that depends of the package
@components
, included using npm link, I had to specify the folder build when i’m trying to import the componentCustomTable
as following:import CustomTable from '@myOrganization/components/build/CustomTable';
The possible solution:
Provide an option in the package.json that defines in what directory the module should be resolved, something like:
Then when I can use:
import CustomTable from '@myOrganization/components/CustomTable';
And the file
CustomTable.js
should be resolved in thebuild
folder.I also posted the feature request in the NPM community:
https://npm.community/t/provide-an-option-to-define-in-what-directory-the-module-will-be-resolved/1540
The text was updated successfully, but these errors were encountered: