Allow each Component to be imported from respective root folder: multi-entry support
See original GitHub issueSorry for the question, but I could not find info in the docs on how to do this.
I have a library of React Components with a source structure similar to: https://github.com/mui-org/material-ui/tree/master/packages/material-ui/src
Is it possible to setup TSDX to build the library so that one can import individual components from their individual root folders?
import Avatar from 'my-library/Avatar';
import Button from 'my-library/Button';
Currently using TSDX we are forced to import all the components from the root index
import { Avatar, Button } from 'my-library';
Thank you.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:3
- Comments:6 (4 by maintainers)
Top Results From Across the Web
Loading a component root folder into a sandbox - IBM
Procedure. Before you begin, import file and folders from Rational ClearCase. Load a shared Rational Team Concert root folder by completing the ...
Read more >Multiple entry points in create-react-app without ejecting
Let's look at the default entry point in a CRA application. The src/index.js file imports the App container and renders it inside the...
Read more >Modules: Packages | Node.js v19.3.0 Documentation
This ensures that there is only one subpath for each exported module so that all dependents import the same consistent specifier, keeping the...
Read more >Get started with the Navigation component - Android Developers
In an app with multiple activity destinations, each activity has its own navigation graph. Add a NavHostFragment via XML. The XML example below ......
Read more >Dependency resolution - Parcel
All extensions listed above are supported for index files. /path/to/project/src/app.js: import './client' ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@ambroseus I had some of the same thoughts today after wrestling with rollup configs and deployment for a new library I wanted to publish. As far as I can tell, rollup’s value propositions are threefold. It allows you to:
left-pad
or whatever)Doesn’t 1 become obsolete when esmodules are available everywhere? And if 1 is gone, I really can’t recommend rollup for 2 or 3 insofar as with 2, I think you should either trust your dependencies or copy-paste them into your codebase, and with 3 I have never been able to cleanly add a dependency to a rollup project without having to deal with one or several of the errors/warnings listed here: https://rollupjs.org/guide/en/#troubleshooting. Rollup is an incredibly finicky consumer of code and rarely am I able to just install a dependency and get it to just compile without tweaking rollup.config.js.
I dunno.
OFF TOPIC
Why in 2020 we still use bundlers with so complex configs/plugins ?? modern browsers/node 12 already support native modules import so why not to throw out webpack/parcell/rollup and start using https://www.snowpack.dev ? 😃