ES6 / JS modules example
See original GitHub issueIs there a way to implement this in ES6 browser processed modules? Trying:
import * as CountUp from 'countup.js'
and getting:
Uncaught ReferenceError: exports is not defined at countUp.min.js:11
Issue Analytics
- State:
- Created 5 years ago
- Comments:7 (4 by maintainers)
Top Results From Across the Web
JavaScript modules - MDN Web Docs
This guide gives you all you need to get started with JavaScript module ... These examples demonstrate a simple set of modules that...
Read more >ES6 - Modules - Tutorialspoint
A module is nothing more than a chunk of JavaScript code written in a file. By default, variables and functions of a module...
Read more >A Practical guide to ES6 modules - freeCodeCamp
JavaScript has had modules for a long time. However, they were implemented via libraries, not built into the language. ES6 is the first...
Read more >16. Modules - Exploring JS
ES6 modules are stored in files. There is exactly one module per file and one file per module. You have two ways of...
Read more >A Comprehensive Look at ES6 Modules - JavaScript Tutorial
An ES6 module is a JavaScript file that executes in strict mode only. It means that any variables or functions declared in the...
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
excellent that worked thank you! next release of the polymer 3 element will use this directly 😃
That’s awesome, thanks for working on it! Since I re-wrote CountUp in typescript, the modules have been a HUGE headache. (Issue thread) Before 2.X, I used
gulp-umd-wrapper
which produced a UMD module and globally scopedCountUp
which is very compatible for everyone… Typescript wrapped UMD module does not makeCountUp
global, which makes bad compatibility, especially with Webpack.So I released again with an
AMD
wrapper, it seemed to be compatible with both requirejs and Webpack. But people still had issues. So I released again with commonjs module wrapping. I found it works well with Browserify and Webpack.I did some tests and was able to use es6 export successfully with vanilla js and webpack. Perhaps I’ll issue another release…