With these changes, a comment is generated before the inlined module to allow other tools to find out the original module name.
For example, webpack can use this to mark the original modules as dependencies for watching those files and rebuilding when the content changes. I've made a webpack loader which does exactly that: https://github.com/elliottsj/babel-inline-import-loader
That loader depends on these changes in order to work; I'd love to get some opinions on this approach.
I've also changed the npm script from "prepublish" to "prepare" so that the script is run when installing the package from git (made testing a bit easier). I can remove this or put it in another PR if you like.
With these changes, a comment is generated before the inlined module to allow other tools to find out the original module name.
For example, webpack can use this to mark the original modules as dependencies for watching those files and rebuilding when the content changes. I've made a webpack loader which does exactly that: https://github.com/elliottsj/babel-inline-import-loader
That loader depends on these changes in order to work; I'd love to get some opinions on this approach.
I've also changed the npm script from "prepublish" to "prepare" so that the script is run when installing the package from git (made testing a bit easier). I can remove this or put it in another PR if you like.