Let's say we have a main-module with 2 dependencies A and B.
dependencyA has an executable script which we want to run as a package.json script in the main module. (yarn run:dependencyA)
dependencyB needs to be dynamically imported by dependencyA.
B can't be a direct dependency of A at build time.
{
"name": "main-module",
"version": "1.0.0",
"type": "module",
"scripts": {
"run:dependencyA": "dependencyA",
"start": "node index.js"
},
"devDependencies": {
"dependencyA": "1.0.0",
"dependencyB": "1.0.0"
}
}
How can the dependencyA script access dependencyB from the main-module when executed?