ES6 Import
See original GitHub issueHi thanks for building this amazing plugin!
Right now I’m having an issue where I try to import this using Browserify with the ES2015 preset and the plugin is not registering with moment.
This currently doesn’t work
import moment from 'moment'
import 'moment-timer'
This throws a TypeError
var timer moment.duration(1, 'seconds').timer()
Uncaught TypeError: _moment2.default.duration(...).timer is not a function
I’m using React as well
Thanks!
Issue Analytics
- State:
- Created 7 years ago
- Reactions:1
- Comments:6 (2 by maintainers)
Top Results From Across the Web
import - JavaScript - MDN Web Docs - Mozilla
The static import declaration is used to import read-only live bindings which are exported by another module. The imported bindings are ...
Read more >ES6 Modules and How to Use Import and Export in JavaScript
The ES2015 (ES6) edition of the JavaScript standard gives us native support for modules with the import and export syntax.
Read more >16. Modules - Exploring JS
The imports of an ES6 module are read-only views on the exported entities. That means that the connections to variables declared inside module...
Read more >How to use an ES6 import in Node.js? - GeeksforGeeks
Introduction to ES6 import: The import statement is used to import modules that are exported by some other module. A module is a...
Read more >Javascript Modules | Export Import Syntax for ES6 Modules
Learn Javascript Modules and the ES6 Module syntax to import and export modules in this Javascript tutorial. Javascript ES6 Modules help you ...
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
sorry for the late response guys, I did come up with a response I will post a PR shortly 😄
It’s because this plugin isn’t wrap into a ‘module’ (I mean a module to be usable by require() or import)
Have a look here : https://github.com/umdjs/umd