Open dasdeo opened 6 months ago
Bundling should work the same regardless from where the bundler was invoked.
If the plugin fails to find a corresponding package.json it will hang forever.
Note that this is not remedied by setting rootDir.
rootDir
I already tracked down the offending function, it is:
async function findPackageJson(base, moduleDirs) { const { root } = path.parse(base); let current = base; while (current !== root && !isModuleDir(current, moduleDirs)) { const pkgJsonPath = path.join(current, 'package.json'); if (await fileExists(pkgJsonPath)) { const pkgJsonString = fs.readFileSync(pkgJsonPath, 'utf-8'); return { pkgJson: JSON.parse(pkgJsonString), pkgPath: current, pkgJsonPath }; } current = path.resolve(current, '..'); } return null; }
Variable current over time:
current
findPackageJson my-virtual-module findPackageJson /Users/dasdeo/Desktop/rollup-bug-repo findPackageJson /Users/dasdeo/Desktop findPackageJson /Users/dasdeo findPackageJson /Users findPackageJson / findPackageJson / findPackageJson / ...
Expected Behavior
Bundling should work the same regardless from where the bundler was invoked.
Actual Behavior
If the plugin fails to find a corresponding package.json it will hang forever.
Note that this is not remedied by setting
rootDir
.Additional Information
I already tracked down the offending function, it is:
Variable
current
over time: