-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Only first entry works when more than one is provided #55
Comments
this is working as expected. you can add another entry to import all components: export { default as Badge} from 'src/components/core/Badge/index.ts';
export { default as CssBaseline} from 'src/components/core/CssBaseline/index.ts';
... $ dts build -i src/index.ts |
Yes, I understand that if you have a barrel index with all your exports you are going to get a bundle with all your files there. |
tsdx was designed to be an opinionated tool, seems not supported this way. But I'm open to add it in the fork. |
It's up to you. I think it might be useful for people writing a component library and don't want it all bundled in one file. I am not sure (correct me if I am wrong) but I think that if all the library comes in one file you cannot leverage tree-shaking. I could give it a go too. BTW, I love your fork TSDX idea is really good but they don't seem to be maintaining it anymore and this fork let me use the last version of ESLint, etc. |
as I can tell, most modern bundlers support esm tree-shaking, webpack/rollup/parcel/... so, it seems not a big deal to make a barrel index. But I agreed not all packages has just one entry, e.g. eslint has two entries: 1) public api; 2) non-officially supported api. https://github.com/eslint/eslint/blob/e3cd1414489ceda460d593ac7e7b14f8ad45d4fc/package.json#L12-L13 |
If I correctly recall, there was one PR (never merged) in tsdx : jaredpalmer#367 Edit: If it helps someone to start, here is a git patch file with the major changes, that could be applied to dts-cli (still issues to deal with tests :( ) |
Current Behavior
When running
dts build -i src/components/core/Badge/index.ts -i src/components/core/CssBaseline/index.ts
the second entry is ignored.
The
dist/
folder only contains the bundle containing the Badge component in this case.Expected behavior
I would expect having bundle files for CssBaseline too.
Suggested solution(s)
I don't have a clue 😂
Additional context
I just want to have one file for each component of a library of React components
Your environment
The text was updated successfully, but these errors were encountered: