mmd
mmd copied to clipboard
Use ES6 to further shave bytes
Just because we can: using ES6 gives us AMD in 90 characters :octopus:
Runs in latest Chrome an Firefox and should probably never be used.
Nice :) But what about ES5 environments?
That's why it doesn't make too much sense unfortunately. Let's wait another 10 years until we have forgotten what bundlers are....
How about this:
try{eval('define=(a,b,c)=>{define[a]=require(c?b:[],c||b)},require=(a,b)=>b(...a.map(c=>define[c]));')}catch(e){throw 'No ES6'}
It´s again 127 characters but it degrades gracefully (somehow).