This commit is contained in:
Percs 2024-10-12 03:12:02 -05:00
commit fda8f4e5c1

View file

@ -68,12 +68,18 @@ export default defineConfig({
VERSION: JSON.stringify(packagemeta.version), VERSION: JSON.stringify(packagemeta.version),
}), }),
new rspack.DefinePlugin({ new rspack.DefinePlugin({
COMMITHASH: JSON.stringify( COMMITHASH: () => {
try {
return JSON.stringify(
execSync("git rev-parse --short HEAD", { encoding: "utf-8" }).replace( execSync("git rev-parse --short HEAD", { encoding: "utf-8" }).replace(
/\r?\n|\r/g, /\r?\n|\r/g,
"" ""
) )
), )
} catch (e) {
return "unknown";
}
},
}), }),
process.env.DEBUG === "true" process.env.DEBUG === "true"
? new RsdoctorRspackPlugin({ ? new RsdoctorRspackPlugin({