Add umd/es6 module exports
See original GitHub issueThis is a feature request.
Even though cjs+babel is the most common way to import modules, a number of projects out there use a es2015-style module imports. Like many libraries out there (like React), it’d be great if there’s a umd
export available for swr
.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:3
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Module.exports and es6 Import - Stack Overflow
I have this confusion with imports and module.exports. I assume babel when converting the ES6 code to ES5 converts the imports and exports...
Read more >Understanding (all) JavaScript module formats and tools
js implements this by wrapping the code inside the file into a function, then passes the exports variable, module variable, and require function ......
Read more >JavaScript Module Formats and Tools - DEV Community
It wraps the module code inside an IIFE. The anonymous function returns an object, which is the placeholder of exported APIs.
Read more >Understanding module.exports and exports in Node.js
James shows how to work with modules in Node.js, focusing on how to export and consume them, and explaining the difference between ...
Read more >commonJs、AMD、UMD、es6模块化的区别,这篇就够了
module.exports属性表示当前模块对外输出的接口,其他文件加载该模块,实际上就是读 ... //moduleA就是moduleA.js模块传入的函数执行后返回的对象{add:function} });.
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 Free
Top 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
+1 from the Workers team at Cloudflare
Hi all! We’ve landed ESM support in v0.1.12 (#140) and it’s now tree-shakeable. Huge thanks to @yesmeck and everyone’s help!
https://bundlephobia.com/result?p=swr@0.1.12