Don't use webpack's value for the module source, because when running webpack-dev-server, the generated modules have `require()` calls that needs loaders. Since Node doesn't have loaders, these `require()` calls will crash.
Instead, generate the module source ourselves by deriving the full asset path from the public path plus the asset's relative path.
You can now specify `fileSystems: [require('fs')]` to force the plugin to write to the real file system. Use `AssetModulePlugin.DefaultFileSystem` to write to the default one that the webpack compiler uses.
The plugin callback was invoked once per asset. Instead we need to invoke it just once, so use `Promise.all` to wait for all of the assets to be compiled before invoking the callback. Eventually we should subscribe to events for individual assets so that we don't re-emit all of the asset modules on every build when using `--watch`.
- README with explanation
- Run `npm run-script build` to build `lib`
- Compiles to ES6 that io.js 2 can run
- eslint is configured
- flow is configured, but had to comment out a class field declaration