babel-plugin-add-filehash
This Babel plugin makes sure the Babel output changes whenever the input
file changes, even if it are only trivial/whitespace changes.
This makes sure subsequent tools like webpack reprocess the file and
show updated eslint messages/... It specificall works around a webpack
bug that loses error messages on "unchanged" files: https://github.com/webpack/webpack/issues/2538
Installation
npm install babel-plugin-add-filehash
Usage
For general info about using Babel plugins see the Babel handbook.
Via .babelrc
(Recommended)
Add the plugin to your projects .babelrc
:
{
"plugins": ["add-filehash"]
}
Via Node API
require("babel-core").transform("code", {
plugins: ["add-filehash"]
});