Unable to externalize a dependency
- Dominant language
- TypeScript
- Stars
- 11.3k
- Forks
- 275
- PR merge metrics
- No merged PRs in 30d
Description
```ts
import { defineConfig } from 'tsup';
export default defineConfig({
clean: true,
entry: ['src/bin/worker.ts', 'src/bin/scheduler.ts'],
external: ['jsdom', 're2', '@contra/temporal-workflows/workflows'],
noExternal: [/^@contra\/(?!temporal-workflows$).*$/u],
sourcemap: true,
splitting: false,
});
```
```
WARN ▲ [WARNING] "@contra/temporal-workflows/workflows" should be marked as external for use with "require.resolve" [require-resolve-not-external] 21:42:10
src/bin/worker.ts:132:35:
132 │ ...owsPath: require.resolve('@contra/temporal-workflows/workflows'),
╵ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
Contributor guide
Research direction
Start with the tsup configuration shown in the issue and the require.resolve call at src/bin/worker.ts:132. Reproduce the warning with the listed entry points and external/noExternal settings, then determine whether the dependency can be externalized without breaking that resolution. Done means the warning is addressed and the worker still resolves the dependency correctly.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- build-system
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100