fix: log accurate version by distribution (#1531)
This commit is contained in:
6
packages/netlify-cms-core/src/bootstrap.js
vendored
6
packages/netlify-cms-core/src/bootstrap.js
vendored
@ -20,7 +20,11 @@ function bootstrap(opts = {}) {
|
||||
/**
|
||||
* Log the version number.
|
||||
*/
|
||||
console.log(`Netlify CMS version ${NETLIFY_CMS_VERSION}`);
|
||||
if (NETLIFY_CMS_VERSION) {
|
||||
console.log(`netlify-cms ${NETLIFY_CMS_VERSION}`);
|
||||
} else if (NETLIFY_CMS_CORE_VERSION) {
|
||||
console.log(`netlify-cms-core ${NETLIFY_CMS_CORE_VERSION}`);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get DOM element where app will mount.
|
||||
|
@ -1,4 +1,6 @@
|
||||
const path = require('path');
|
||||
const webpack = require('webpack');
|
||||
const pkg = require('./package.json');
|
||||
const FriendlyErrorsWebpackPlugin = require('friendly-errors-webpack-plugin');
|
||||
const { getConfig, rules, plugins } = require('../../scripts/webpack.js');
|
||||
|
||||
@ -47,6 +49,10 @@ module.exports = {
|
||||
...Object.entries(plugins)
|
||||
.filter(([ key ]) => key !== 'friendlyErrors')
|
||||
.map(([ _, plugin ]) => plugin()),
|
||||
new webpack.DefinePlugin({
|
||||
NETLIFY_CMS_VERSION: null,
|
||||
NETLIFY_CMS_CORE_VERSION: JSON.stringify(`${pkg.version}${isProduction ? '' : '-dev'}`),
|
||||
}),
|
||||
new FriendlyErrorsWebpackPlugin({
|
||||
compilationSuccessInfo: {
|
||||
messages: ['Netlify CMS is now running at http://localhost:8080'],
|
||||
|
Reference in New Issue
Block a user