Closed StrikeAgainst closed 3 years ago
Hi, you can provide a HeaderProvider in the headers
config which is already a function executed each time the header is computed.
The function will receive an object of DataObject as the only argument, which contains the desired buildNo
field.
You can read the buildNo
and tweak the version yourself.
An simple example as follows,
module.exports = {
plugins: [
new WebpackUserscript({
headers (data) {
const paddedBuildNo = String(data.buildNo).padStart(3, “0”)
return {
version: `${data.version}-build.${paddedBuildNo}`
}
}
})
]
}
I’ll close the issue since the current API can already fulfill the requirement.
Feel free to reopen this if it is still an issue to you. 🤗
I have a feature request regarding the automated
buildNo
incrementation for hot development. While I very much like this feature, I sometimes have issues updating the script in FireMonkey, as the internal version comparison logic for FireMonkey seemingly cannot deal with growing figures; e.g. when I'm updating the build from3.3.1.9
to3.3.1.10
, then no update is registered, forcing me to tweak the version number manually to trigger an update. While this is just a minor complaint, it would provide some ease of use if we could supply a function which would allow us to process the providedbuildNo
before it's integrated into the version. In my case I would pad the number with zeroes to work around the issue with the figures.