egoist / egoist/tsup

File loader doesn't work for .md files

Open
#785 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
11.3k
Forks
275
PR merge metrics
No merged PRs in 30d

Description

I want to copy readme.md file to `/dist` so entire folder can be submitted to npm

Repo where this can be reproduced:
https://github.com/saleor/saleor-app-sdk/blob/main/tsup.config.ts

1. Add `README.md` to `entries`
2. Add `loader: { '.md': 'file' }` to config

## Expected
file will be copied to dist

## Actual

Error
```
DTS Build start
error TS6054: File '/Users/lukasz/projects/saleor-app-sdk/README.md' has an unsupported extension. The only supported extensions are '.ts', '.tsx', '.d.ts', '.cts', '.d.cts', '.mts', '.d.mts'.
The file is in the program because:
Root file specified for compilation
```

Adding `*.md` to tsconfig `excludes` doesn't change anything

Contributor guide

Open the contributing guide

Research direction

Reproduce the issue using the linked tsup.config.ts with README.md in entries and loader: { '.md': 'file' }, then inspect how the DTS build handles those entry files and the tsconfig exclusion. Done means the markdown file is copied to dist without the reported TS6054 error.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
build-system
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.