Skip to content
This repository has been archived by the owner on Oct 23, 2019. It is now read-only.

Annotate assets with es module import/export specifiers #121

Open
markfinger opened this issue Jul 1, 2016 · 1 comment
Open

Annotate assets with es module import/export specifiers #121

markfinger opened this issue Jul 1, 2016 · 1 comment

Comments

@markfinger
Copy link
Owner

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:

  • how to reconcile against commonjs imports? Fail silently? How to detect if a module uses es modules, or commonjs, or both?
  • when should specifiers be extracted? before babel transformation or after? both? if both, how to merge and handle specifiers that were removed?
@markfinger
Copy link
Owner Author

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 {}

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant