@@ -2,13 +2,16 @@ const path = require('path');
22
33const MiniCSSExtractPlugin = require ( 'mini-css-extract-plugin' ) ;
44const MonacoWebpackPlugin = require ( 'monaco-editor-webpack-plugin' ) ;
5+ const webpack = require ( 'webpack' ) ;
56const srcRoot = path . resolve ( __dirname , 'src' ) ;
67const uiKitRoot = path . resolve ( __dirname , 'node_modules/@gravity-ui/uikit' ) ;
78const antlr4C3Root = path . resolve ( __dirname , 'node_modules/antlr4-c3' ) ;
89const websqlRoot = path . resolve ( __dirname , 'node_modules/@gravity-ui/websql-autocomplete' ) ;
910const antlr4ngRoot = path . resolve ( __dirname , 'node_modules/antlr4ng' ) ;
1011const uiKitIconsRoot = path . resolve ( __dirname , 'node_modules/@gravity-ui/icons' ) ;
1112
13+ const packageJson = require ( './package.json' ) ;
14+
1215module . exports = {
1316 webpack : ( config , env ) => {
1417 const oneOfRule = config . module . rules . find ( ( r ) => r . oneOf ) ;
@@ -45,6 +48,13 @@ module.exports = {
4548 } ) ,
4649 ) ;
4750
51+ // Add DefinePlugin to expose just the version
52+ config . plugins . push (
53+ new webpack . DefinePlugin ( {
54+ 'process.env.UI_VERSION' : JSON . stringify ( packageJson . version ) ,
55+ } ) ,
56+ ) ;
57+
4858 const cssExtractPlugin = config . plugins . find ( ( p ) => p instanceof MiniCSSExtractPlugin ) ;
4959 if ( cssExtractPlugin ) {
5060 cssExtractPlugin . options . ignoreOrder = true ;
0 commit comments