ES6 Module Support?
See original GitHub issueI am trying to use this library in a polymer 3 typescript project. Would it be possible to add support for es6 modules?
Code
import dayjs from 'dayjs';
Result
my-app.ts:73 One or more components failed to load SyntaxError: The requested module '../node_modules/dayjs/dayjs.min.js' does not provide an export named 'default'
Workaround
<script src="node_modules/dayjs/dayjs.min.js" async></script>
Issue Analytics
- State:
- Created 5 years ago
- Reactions:2
- Comments:22 (5 by maintainers)
Top Results From Across the Web
JavaScript modules via script tag | Can I use... Support tables ...
Loading JavaScript module scripts (aka ES6 modules) using <script type="module"> Includes support for the nomodule attribute. Usage % of. all users, all tracked ......
Read more >JavaScript modules - MDN Web Docs
This guide gives you all you need to get started with JavaScript module syntax.
Read more >16. Modules - Exploring JS
Their support for cyclic dependencies is better than CommonJS's. The ES6 module standard has two parts: Declarative syntax (for importing and exporting) ...
Read more >Using ES Modules in the Browser Today - SitePoint
The Current ES Modules Landscape ... Safari, Chrome, Firefox and Edge all support the ES6 Modules import syntax. Here's what they look like....
Read more >ES6 modules in the browser: are they ready yet?
First things first, the browser support: as I write this at the start of 2020, it's a pretty respectable 90%. https://caniuse.com/#feat=es6-module.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
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

I try that:
and I get
dayjs is not a functionHow come there is no sample of ES6 import in the docs?try this
import * as dayjs from 'dayjs';