Skip to content
This repository has been archived by the owner on Oct 25, 2022. It is now read-only.

Commit

Permalink
ci: Add commit hash to filename
Browse files Browse the repository at this point in the history
  • Loading branch information
oliversalzburg committed Apr 27, 2022
1 parent eb5efd5 commit 8e1dac1
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion packages/userscript/webpack.config.userscript.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@ const PnpWebpackPlugin = require("pnp-webpack-plugin");
const TerserPlugin = require("terser-webpack-plugin");
const WebpackUserscript = require("webpack-userscript");

const filename = [
"kitten-scientists",
isDevBuild ? "-dev" : "",
process.env.GITHUB_SHA ? `-${String(process.env.GITHUB_SHA).substring(0, 7)}` : "",
".user.js",
];

module.exports = {
entry: path.resolve(__dirname, "source", "index.ts"),
mode: isDevBuild ? "development" : "production",
Expand All @@ -24,7 +31,7 @@ module.exports = {
},
output: {
path: path.resolve(__dirname, "bundle"),
filename: `kitten-scientists${isDevBuild ? "-dev" : ""}.user.js`,
filename: filename.join(""),
},
plugins: [
new WebpackUserscript({
Expand Down

0 comments on commit 8e1dac1

Please sign in to comment.