2019-03-28 11:37:23 -07:00
|
|
|
const webpack = require('webpack');
|
|
|
|
const pkg = require('./package.json');
|
|
|
|
const { getConfig, plugins } = require('../../scripts/webpack');
|
|
|
|
const baseWebpackConfig = getConfig({ baseOnly: true });
|
|
|
|
|
|
|
|
const isProduction = process.env.NODE_ENV === 'production';
|
|
|
|
console.log(`${pkg.version}${isProduction ? '' : '-dev'}`);
|
|
|
|
|
|
|
|
const baseConfig = {
|
|
|
|
...baseWebpackConfig,
|
|
|
|
plugins: [
|
|
|
|
...Object.entries(plugins)
|
|
|
|
.filter(([key]) => key !== 'friendlyErrors')
|
|
|
|
.map(([, plugin]) => plugin()),
|
|
|
|
new webpack.DefinePlugin({
|
2019-04-04 11:16:06 -07:00
|
|
|
NETLIFY_CMS_APP_VERSION: JSON.stringify(`${pkg.version}${isProduction ? '' : '-dev'}`),
|
2019-03-28 11:37:23 -07:00
|
|
|
}),
|
|
|
|
],
|
|
|
|
};
|
|
|
|
|
|
|
|
module.exports = baseConfig;
|