Skip to content

Commit

Permalink
import?
Browse files Browse the repository at this point in the history
  • Loading branch information
fregante committed Jun 27, 2024
1 parent e1d4eb5 commit 1f925f1
Showing 1 changed file with 2 additions and 22 deletions.
24 changes: 2 additions & 22 deletions api/bundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,28 +82,8 @@ const bundle = memoize(async (nameRequest, globalName) => {
'--no-bin-links',
]);

const fs = require('node:fs');

fs.readdir(resolve(cwd, 'node_modules', package_.name), (error, files) => {
console.log('----pkg');
for (const file of files) {
console.log(file);
}
});
fs.readdir(resolve(cwd, 'node_modules'), (error, files) => {
console.log('----node pkg');
for (const file of files) {
console.log(file);
}
});
fs.readdir(resolve(cwd), (error, files) => {
console.log('----cwd');
for (const file of files) {
console.log(file);
}
});
console.log(fs.readFileSync(resolve(cwd, 'node_modules', package_.name, 'package.json'), 'utf8'));
const packagePath = require.resolve(resolve(cwd, 'node_modules', package_.name));
await import(nameRequest);
const packagePath = import.meta.resolve(resolve(cwd, 'node_modules', package_.name));

return {
version: package_.version,
Expand Down

0 comments on commit 1f925f1

Please sign in to comment.