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.

rewrite in es6 modules

See original GitHub issue

i’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:open
  • Created 9 years ago
  • Comments:16 (14 by maintainers)

github_iconTop GitHub Comments

5reactions
ogonkovcommented, May 3, 2018

Having Modernizr as ES6 modules would be really nice feature to have

3reactions
niksycommented, Feb 12, 2019

@ogonkov @alexturpin @adekbadek I’m maintaining ESM build of Modernizr if you’re still interested!

Read more comments on GitHub >

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

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