The tilde ~
and caret ^
symbols in package.json Webpack
Difference
From this answer: https://stackoverflow.com/a/22345808/3123549
~version
“Approximately equivalent to version”, will update you to all future patch versions, without incrementing the minor version.~1.2.3
will use releases from1.2.3
to<1.3.0
.^version
“Compatible with version”, will update you to all future minor/patch versions, without incrementing the major version.^2.3.4
will use releases from2.3.4
to<3.0.0
.
Semantic Versioning (semver)
From the document: https://semver.org/
Given a version number
MAJOR
.MINOR
.PATCH
, for example:2.0.0
, increment the:
MAJOR
version when you make incompatible API changes.MINOR
version when you add functionality in a backwards compatible manner.PATCH
version when you make backwards compatible bug fixes.Additional labels for pre-release and build metadata are available as extensions to the MAJOR.MINOR.PATCH format.
Reference
- https://stackoverflow.com/a/22345808/3123549
- Click https://semver.org/ if you’d like to deep dive into Semver
“One day, all your hard work will pay off.”