Skip to content

Commit 6a13931

Browse files
committed
Add version and build date to minified JavaScript.
1 parent 6cb0e13 commit 6a13931

File tree

5 files changed

+138
-6
lines changed

5 files changed

+138
-6
lines changed

DEVELOPING.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
# Bump version
3030

3131
1. Update changelog.md
32+
1. Update package.json
3233
1. Run all build processes: `poe build`
3334
1. `poetry version major|minor|patch`
3435
1. Commit/tag/push version bump

django_unicorn/static/unicorn/js/unicorn.min.js

Lines changed: 2 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package-lock.json

Lines changed: 127 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
{
2+
"version": "0.48.0",
3+
"name": "django-unicorn",
24
"scripts": {
35
"build": "npx rollup -c",
46
"test": "npx ava",
@@ -26,7 +28,8 @@
2628
"rollup-plugin-commonjs": "^10.1.0",
2729
"rollup-plugin-filesize": "^6.2.1",
2830
"rollup-plugin-node-resolve": "^5.2.0",
29-
"rollup-plugin-terser": "^7.0.1"
31+
"rollup-plugin-terser": "^7.0.1",
32+
"rollup-plugin-version-injector": "^1.3.3"
3033
},
3134
"ava": {
3235
"require": [
@@ -37,6 +40,5 @@
3740
"!tests/js/utils.js"
3841
],
3942
"failFast": true
40-
},
41-
"name": "django-unicorn"
43+
}
4244
}

rollup.config.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { terser } from "rollup-plugin-terser";
33
import commonjs from "@rollup/plugin-commonjs";
44
import resolve from "@rollup/plugin-node-resolve";
55
import babel from "@rollup/plugin-babel";
6+
import versionInjector from "rollup-plugin-version-injector";
67

78
export default {
89
input: "django_unicorn/static/unicorn/js/unicorn.js",
@@ -13,11 +14,12 @@ export default {
1314
},
1415
plugins: [
1516
resolve(),
16-
filesize(),
1717
terser({
1818
mangle: true,
1919
}),
20+
versionInjector(),
2021
commonjs({}),
2122
babel({ babelHelpers: "bundled" }),
23+
filesize(),
2224
],
2325
};

0 commit comments

Comments
 (0)