Rollup bundling process does not handle "~" alias
leopuleo opened this issue · comments
Describe the bug
It looks like Rollup is not handling the ~
substitution with src
folder path. This is ok when you inspect the dist
folder generated inside the repo...but it fails to build inside a project which uses react-dnd-treeview
as dependency.
I hope you can fix this...the library does a great job! :)
To Reproduce
Steps to reproduce the behavior:
- Add
react-dnd-treeview
as dependency in a TS project - Navigate to the package folder inside
node_modules
- Open any file that imports
~/types
- i.e./dist/hooks/useContainerClassName.d.ts(
- See screenshots
Expected behavior
Transpiled files should contain ../src/
instead of ~
@leopuleo Thanks for the report!
I understood the problem, but for some reason in my environment I am able to build without any problems.
I would like to reproduce the build error, but it would be helpful if you could tell me your build configuration.
Hello @minop1205,
thanks for such a quick reply.
To reproduce the error:
- Create a new react application (typescript) -> https://create-react-app.dev/docs/adding-typescript/
- Add
react-dnd-treeview
as a dependency and re-create the demo you listed on this repo. - Inside
tsconfig.json
setskipLibCheck: false
(or just delete the line) - Run
tsc
command.
You should see the errors.
Let me know if you need any other help.
@leopuleo Thanks for the details!
I did some research and found the following link with some helpful information.
ezolenko/rollup-plugin-typescript2#201
The fix is reflected in the package we just released as an alpha version, so please try it.
npm i @minoru/react-dnd-treeview@alpha
I will make an official release of v3.2 with this fix after I address several other Issues.
Thank you very much.
Thanks @minop1205, just installed the alpha
version and the project compiles!
Thank you for such a quick response.