Enhancements to module exports
See original GitHub issueEnhance exports Currently modules/classes can only be imported from the single file they are exported from.
Users may benefit from importing the whole library:
import ol from 'ol';
const layer = new ol.layer.Tile();
… or a single namespace:
import control from 'ol/control';
const OverviewMap = new control.OverviewMap();
Also the naming of default exports could be improved (i.e. append the name of the containing directory’) so IntelliSense finds them more easily, e.g.
class OSMSource extends XYZ {}; // instead of `class OSM extends XYZ`
export default OSMSource
See suggestion of @ahocevar for reference: https://github.com/openlayers/openlayers/issues/9358#issuecomment-475170787
Issue Analytics
- State:
- Created 4 years ago
- Comments:7 (6 by maintainers)
Top Results From Across the Web
Node.js Module Exports Explained | Scout APM Blog
This post will cover the use of modules in Node.js, what they are, why they are essential, and how to export and import...
Read more >Understanding Node.js Module Exports - Atatus
This article will go through what module exports are, ... In the world of Javascript, these enhancements come in a variety of formats....
Read more >module.exports colliding / being overwritten in node.js ...
I think I'm badly misunderstanding how to use module.exports. It seems every module is overwriting what the last one spit out. app.js:
Read more >NodeJS Export and Import Modules - DigitalOcean
NodeJS Export and Import Modules · To export all these three, we have to use same technique. · Here we have exported PI...
Read more >ECMAScript modules | Node.js v19.3.0 Documentation
When importing CommonJS modules, the module.exports object is provided as the default export. Named exports may be available, provided by static analysis as...
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
Ah ok. Got it. I just have to keep
/src/ol/source.js
as it is.This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.