question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add umd/es6 module exports

See original GitHub issue

This 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:closed
  • Created 4 years ago
  • Reactions:3
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
mpintcommented, Nov 19, 2019

+1 from the Workers team at Cloudflare

0reactions
shudingcommented, Nov 21, 2019

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

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found