We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f13afd1 commit 23cb34cCopy full SHA for 23cb34c
src/index.js
@@ -5,4 +5,7 @@ import css from './css/index.styl';
5
6
polyfill();
7
8
+/* eslint no-undef:0 */
9
+ImageViewer.version = __VERSION__;
10
+
11
export default ImageViewer;
webpack.config.base.js
@@ -1,4 +1,11 @@
1
+const fs = require('fs');
2
const path = require('path');
3
+const webpack = require('webpack');
4
+const getVersion = () => {
+ const json = JSON.parse(fs.readFileSync('./package.json').toString());
+ return json.version;
+};
const config = {
entry: {
@@ -72,7 +79,11 @@ const config = {
72
79
}
73
80
]
74
81
},
75
- plugins: []
82
+ plugins: [
83
+ new webpack.DefinePlugin({
84
+ __VERSION__: JSON.stringify(getVersion())
85
+ })
86
+ ]
76
87
};
77
88
78
89
module.exports = config;
0 commit comments