Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generate comment with original module name next to inlined module, e.g. for webpack watching & rebuilding #10

Merged
merged 3 commits into from
Jul 16, 2017

Conversation

elliottsj
Copy link
Contributor

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.

@zvictor
Copy link
Contributor

zvictor commented Jul 16, 2017

it is beautiful, thanks!

@zvictor zvictor merged commit 9d384be into feats:master Jul 16, 2017
@elliottsj elliottsj deleted the leading-comment-path branch July 20, 2017 19:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants