2018-07-27 14:26:03 -04:00
|
|
|
const webpack = require('webpack');
|
|
|
|
const pkg = require('./package.json');
|
2019-03-16 15:44:29 -07:00
|
|
|
const { getConfig } = require('../../scripts/webpack.js');
|
2018-07-24 00:27:49 -04:00
|
|
|
|
|
|
|
const isProduction = process.env.NODE_ENV === 'production';
|
|
|
|
|
2019-03-16 15:44:29 -07:00
|
|
|
const versionPlugin = new webpack.DefinePlugin({
|
|
|
|
NETLIFY_CMS_CORE_VERSION: JSON.stringify(`${pkg.version}${isProduction ? '' : '-dev'}`),
|
|
|
|
});
|
2018-07-17 19:13:52 -04:00
|
|
|
|
2021-02-08 20:01:21 +02:00
|
|
|
function configs() {
|
2019-03-16 15:44:29 -07:00
|
|
|
return getConfig().map(config => {
|
|
|
|
return {
|
|
|
|
...config,
|
|
|
|
plugins: [...config.plugins, versionPlugin],
|
|
|
|
};
|
|
|
|
});
|
2021-02-08 20:01:21 +02:00
|
|
|
}
|
2019-03-16 15:44:29 -07:00
|
|
|
|
|
|
|
module.exports = configs();
|