chore: use git commit hash as nextjs build id

This commit is contained in:
DIYgod 2022-10-09 01:34:54 +01:00
parent dcf7d51046
commit 6ecf9fc7dc
No known key found for this signature in database
GPG Key ID: D159328F47A80DCA
1 changed files with 7 additions and 0 deletions

View File

@ -5,6 +5,9 @@ const { withIpfsGateway } = require("@crossbell/ipfs-gateway-next")
const withBundleAnalyzer = require("@next/bundle-analyzer")({
enabled: process.env.ANALYZE === "true",
})
const execSync = require("child_process").execSync
const lastCommitCommand = "git rev-parse HEAD"
class UnoCSS {
/**
@ -51,5 +54,9 @@ module.exports = withBundleAnalyzer(
"default-src 'self'; script-src 'none'; sandbox; style-src 'unsafe-inline';",
remotePatterns: [{ hostname: "**" }],
},
async generateBuildId() {
return execSync(lastCommitCommand).toString().trim()
},
}),
)