markfinger / unfort

Development-oriented build tool for the web
MIT License
74 stars 1 forks source link

Annotate assets with es module import/export specifiers #121

Open markfinger opened 8 years ago

markfinger commented 8 years ago

If assets are annotated with both their imported and exported specifiers (including default), this would enable validation of dependencies during the build, rather than relying on vague runtime failures for detection (eg: _lodash["somefunc"] is not a function`).

Issues:

markfinger commented 8 years ago

As a novel side-effect, this would also enable static analysis of css-module dependencies.

Eg: the following would produce an error

// foo.js
import {button} from './bar.css';
/* bar.css */
.buton {}