Skip to content

Commit a998ae6

Browse files
nam-hleclaude
andcommitted
fix: add __filename and __dirname shims to nadle-lsp ESM banner
TypeScript uses __filename internally for case-sensitivity detection. When bundled into ESM output, this is undefined. Add shims derived from import.meta.url alongside the existing createRequire shim. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 3f4bc92 commit a998ae6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/nadle-lsp/tsup.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,6 @@ export default defineConfig({
1313
},
1414
noExternal: ["vscode-languageserver", "vscode-languageserver-textdocument", "typescript"],
1515
banner: {
16-
js: "import { createRequire } from 'module'; const require = createRequire(import.meta.url);"
16+
js: "import { createRequire } from 'module'; import { fileURLToPath } from 'url'; import { dirname } from 'path'; const require = createRequire(import.meta.url); const __filename = fileURLToPath(import.meta.url); const __dirname = dirname(__filename);"
1717
}
1818
});

0 commit comments

Comments
 (0)