The rough underlying implementation is more or less done. Right now we're deciding betwen two forms, require('a.png')
vs. requireStatic('a.png')
.
- Pros: more familiar. One single
require
for assets too. - Cons: Doesn't follow the CommonJS specs. Overloads
require
.
- Pros: isn't tied to CommonJS.
- Cons: another thing to learn.
Requiring an image returns the image path. Requiring a css returns an object that maps from the class name to a (possibly) namespaced class name.
<div className={a['.class']} />