From ea509702b6ed88951a1b7b109b5dc597ee81112d Mon Sep 17 00:00:00 2001 From: Kristóf Marussy Date: Sat, 2 Oct 2021 16:53:46 +0200 Subject: feat(web): add client-side logging support Also modified langauge-web/src/main/js/xtext/ServiceBuilder.js to make sure the new logger is used as soon as xtext is initialized. --- language-web/webpack.config.js | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'language-web/webpack.config.js') diff --git a/language-web/webpack.config.js b/language-web/webpack.config.js index 1bd0edb2..c51d55d6 100644 --- a/language-web/webpack.config.js +++ b/language-web/webpack.config.js @@ -1,11 +1,14 @@ const fs = require('fs'); const path = require('path'); +const { DefinePlugin } = require('webpack'); const HtmlWebpackPlugin = require('html-webpack-plugin'); const HtmlWebpackInjectPreload = require('@principalstudio/html-webpack-inject-preload'); const MiniCssExtractPlugin = require('mini-css-extract-plugin'); const { SubresourceIntegrityPlugin } = require('webpack-subresource-integrity'); +const packageInfo = require('./package.json'); + const currentNodeEnv = process.env.NODE_ENV || 'development'; const devMode = currentNodeEnv !== 'production'; const outputPath = path.resolve(__dirname, 'build/webpack', currentNodeEnv); @@ -194,6 +197,11 @@ module.exports = { }, }, plugins: [ + new DefinePlugin({ + 'DEBUG': JSON.stringify(devMode), + 'PACKAGE_NAME': JSON.stringify(packageInfo.name), + 'PACKAGE_VERSION': JSON.stringify(packageInfo.version), + }), new MiniCssExtractPlugin({ filename: '[name].[contenthash].css', chunkFilename: '[name].[contenthash].css', -- cgit v1.2.3-54-g00ecf