Expose all classes exports at top level
See original GitHub issuefor instance, export LoaderVolumes instead of Loaders.Volumes.
That allows us to use named imports:
import {LoaderVolumes} from 'ami.js';
otherwise it is pretty chaotic:
import AMI from 'ami.js'
...
const LoaderVolumes = AMI.Loaders.Volumes;
Main benefit will be at compilation time where bundler will only import the required deps (LoaderVolumes) instead of the full package.
1 - ami.js
...
export * from './geometries/Geometries.js';
...
2- geometries.js:
...
export {GeometriesSlice} from './geometries.slice.js';
3- geometries.slice.js
class GeometriesSlice
...
export {GeometriesSlice}
Issue Analytics
- State:
- Created 6 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
How to expose all module classes through index.js in Node
Change node_modules/mymodule/lib/mymodule.js to: var exports = module.exports = { version: '0.0.1' } exports.A = require('./a');.
Read more >How to use module.exports in Node.js - Stack Abuse
We've added all the variables and functions we would like to export to module.exports as properties of the object. We have just accomplished ......
Read more >New bundled TypeScript typings do not expose various top ...
I stumbled over the same lost exported top-level Logger type when upgrading to the new version. I agree it should be a patch,...
Read more >Documentation - Modules - TypeScript
If you're only exporting a single class or function , use export default · If you're exporting multiple objects, put them all at...
Read more >Export and Import - The Modern JavaScript Tutorial
Here are all types of export that we covered in this and previous articles. ... Standalone export: ... Re-export: ... Import: Importing named...
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
that’d be great! I didn’t know about
jscodeshift
, please do not hesitate if you have any question!thanks @marcinlichwala
To the dev branch!
Thanks @marcinlichwala