2022-10-14 13:52:02 -07:00
|
|
|
import { resolve } from 'path';
|
|
|
|
|
2022-10-14 14:00:18 -07:00
|
|
|
import type { LoaderContext } from 'webpack';
|
2022-10-14 13:52:02 -07:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Forces recompile whenever the current commit changes.
|
|
|
|
* Useful for generating the version hash in the UI.
|
|
|
|
*/
|
|
|
|
function loader(this: LoaderContext<{}>, content: string) {
|
|
|
|
this.addDependency(resolve(__dirname, '../../.git/logs/HEAD'));
|
|
|
|
this.callback(undefined, content);
|
|
|
|
}
|
|
|
|
|
|
|
|
export default loader;
|