Skip to content

Commit

Permalink
feat: add resolve cache
Browse files Browse the repository at this point in the history
  • Loading branch information
shigma committed Feb 11, 2024
1 parent 06952a1 commit d541bab
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
3 changes: 0 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@
"lib",
"src"
],
"workspaces": [
"examples/*"
],
"repository": {
"type": "git",
"url": "git+https://github.com/shigma/dunble.git"
Expand Down
1 change: 0 additions & 1 deletion src/bin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,5 @@ const argv = cli.parse()
if (!argv.options.help) {
const manifest = await readFile(join(cwd, 'package.json'), 'utf8').then(JSON.parse)
const tsconfig = await load(cwd)

await dunble(cwd, manifest, tsconfig, argv.options)
}
6 changes: 6 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,12 @@ const externalPlugin = (meta: PackageJson, exports: Record<string, Record<string
resolveDir: args.resolveDir,
kind: args.kind,
})
if (!path) {
// type reflection
const ext = extname(args.path)
const filename = relative(cwd, join(args.resolveDir, args.path.slice(0, -ext.length)))
console.log(filename, exports)
}
if (currentEntry === path || !exports[path]) return null
if (format === 'cjs') return { external: true }
// native ESM import should preserve extensions
Expand Down

0 comments on commit d541bab

Please sign in to comment.