rewrite in es6 modules
See original GitHub issuei’m currently working on https://github.com/normalize/package-management. the idea is that i should be able to just create a custom modernizr file like so from my app:
import 'https://github.com/modernizr/modernizr/3.0.0/feature-detects/css/boxshadow.js'
import 'https://github.com/modernizr/modernizr/3.0.0/feature-detects/css/boxsizing.js'
and simply do <script src="modernizr-custom.js">
in my <head>
. all the modernizr parts will eventaully be spdy pushed in development, and there will be an optional compile step to concat/minify.
currently, everything is written AMD, which would require a lot of detangling to work with ES6 modules (i mean i could, but i’m lazy). would be nice if modernizr were rewritten using ES6 modules (and of course compile down to ES4 when creating builds). it would also make all the source code easier to read as well as make modernizr future-proof.
Issue Analytics
- State:
- Created 9 years ago
- Comments:16 (14 by maintainers)
Top Results From Across the Web
16. Modules - Exploring JS
ES6 is the first time that JavaScript has built-in modules. ... As an example, the previous CommonJS module, rewritten as an ES6 module,...
Read more >A Practical guide to ES6 modules - freeCodeCamp
In this article, we'll create a simple dashboard using ES6 modules, and then present optimization techniques for improving the folder structure ...
Read more >A Comprehensive Look at ES6 Modules - JavaScript Tutorial
Summary: in this tutorial, you will learn about ES6 modules and how to export variables, functions, and classes from a module, and reuse...
Read more >rewrite require to import statement - javascript - Stack Overflow
With ES6 imports, importing * is not the equivalent of what require() does. What you are looking to get is the default module...
Read more >ES6 - Modules - Tutorialspoint
Consider a scenario where parts of JavaScript code need to be reused. ES6 comes to your rescue with the concept of Modules. A...
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
Having Modernizr as ES6 modules would be really nice feature to have
@ogonkov @alexturpin @adekbadek I’m maintaining ESM build of Modernizr if you’re still interested!