Similar to nodejs
import raw from "raw.macro"; const markdown = raw("./README.md");
I came across a few problem when using
- I need to use webpack loader syntax (which needs to be disabled via eslint).
- Some newlines are removed unintentionally.
This can also be useful in environment where webpack is not available / not extensible. Just use babel and you're good to go.