22 lines
525 B
JavaScript
Raw Normal View History

const webpack = require('webpack');
const pkg = require('./package.json');
const { getConfig } = require('../../scripts/webpack.js');
2018-07-24 00:27:49 -04:00
const isProduction = process.env.NODE_ENV === 'production';
const versionPlugin = new webpack.DefinePlugin({
NETLIFY_CMS_CORE_VERSION: JSON.stringify(`${pkg.version}${isProduction ? '' : '-dev'}`),
});
2018-07-17 19:13:52 -04:00
function configs() {
return getConfig().map(config => {
return {
...config,
plugins: [...config.plugins, versionPlugin],
};
});
}
module.exports = configs();