From 22137ed7775a86f4eb6b8d96438c920e91a6f088 Mon Sep 17 00:00:00 2001 From: Joseph Earl Date: Sat, 15 Apr 2017 01:35:08 +0100 Subject: [PATCH] Fixes #292 Display version number --- src/index.js | 3 +++ webpack.dev.js | 3 +++ webpack.prod.js | 3 +++ 3 files changed, 9 insertions(+) diff --git a/src/index.js b/src/index.js index 4efcd6c6..70a2a28a 100644 --- a/src/index.js +++ b/src/index.js @@ -11,6 +11,9 @@ if (process.env.NODE_ENV !== 'production') { require('./utils.css'); // eslint-disable-line } +// Log the version number +console.log(`Netlify CMS version ${NETLIFY_CMS_VERSION}`); + // Create mount element dynamically const el = document.createElement('div'); el.id = 'root'; diff --git a/webpack.dev.js b/webpack.dev.js index f4447beb..2c020032 100644 --- a/webpack.dev.js +++ b/webpack.dev.js @@ -45,6 +45,9 @@ module.exports = merge.smart(require('./webpack.base.js'), { NODE_ENV: JSON.stringify('development'), }, }), + new webpack.DefinePlugin({ + NETLIFY_CMS_VERSION: JSON.stringify(require("./package.json").version + "-dev") + }), new webpack.optimize.OccurenceOrderPlugin(), new webpack.HotModuleReplacementPlugin(), new webpack.NoErrorsPlugin(), diff --git a/webpack.prod.js b/webpack.prod.js index 8a57929a..a8ae5768 100644 --- a/webpack.prod.js +++ b/webpack.prod.js @@ -30,6 +30,9 @@ module.exports = merge.smart(require('./webpack.base.js'), { NODE_ENV: JSON.stringify('production'), }, }), + new webpack.DefinePlugin({ + NETLIFY_CMS_VERSION: JSON.stringify(require("./package.json").version) + }), new webpack.optimize.OccurenceOrderPlugin(), // Minify and optimize the JavaScript