diff options
author | Kristóf Marussy <marussy@mit.bme.hu> | 2021-10-02 16:53:46 +0200 |
---|---|---|
committer | Kristóf Marussy <marussy@mit.bme.hu> | 2021-10-02 16:58:31 +0200 |
commit | ea509702b6ed88951a1b7b109b5dc597ee81112d (patch) | |
tree | 241b9732e7094ef22e7860a9e97a9f67b5b63509 /language-web/webpack.config.js | |
parent | perf(web): split off CodeMirror chunks (diff) | |
download | refinery-ea509702b6ed88951a1b7b109b5dc597ee81112d.tar.gz refinery-ea509702b6ed88951a1b7b109b5dc597ee81112d.tar.zst refinery-ea509702b6ed88951a1b7b109b5dc597ee81112d.zip |
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.
Diffstat (limited to 'language-web/webpack.config.js')
-rw-r--r-- | language-web/webpack.config.js | 8 |
1 files changed, 8 insertions, 0 deletions
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 @@ | |||
1 | const fs = require('fs'); | 1 | const fs = require('fs'); |
2 | const path = require('path'); | 2 | const path = require('path'); |
3 | 3 | ||
4 | const { DefinePlugin } = require('webpack'); | ||
4 | const HtmlWebpackPlugin = require('html-webpack-plugin'); | 5 | const HtmlWebpackPlugin = require('html-webpack-plugin'); |
5 | const HtmlWebpackInjectPreload = require('@principalstudio/html-webpack-inject-preload'); | 6 | const HtmlWebpackInjectPreload = require('@principalstudio/html-webpack-inject-preload'); |
6 | const MiniCssExtractPlugin = require('mini-css-extract-plugin'); | 7 | const MiniCssExtractPlugin = require('mini-css-extract-plugin'); |
7 | const { SubresourceIntegrityPlugin } = require('webpack-subresource-integrity'); | 8 | const { SubresourceIntegrityPlugin } = require('webpack-subresource-integrity'); |
8 | 9 | ||
10 | const packageInfo = require('./package.json'); | ||
11 | |||
9 | const currentNodeEnv = process.env.NODE_ENV || 'development'; | 12 | const currentNodeEnv = process.env.NODE_ENV || 'development'; |
10 | const devMode = currentNodeEnv !== 'production'; | 13 | const devMode = currentNodeEnv !== 'production'; |
11 | const outputPath = path.resolve(__dirname, 'build/webpack', currentNodeEnv); | 14 | const outputPath = path.resolve(__dirname, 'build/webpack', currentNodeEnv); |
@@ -194,6 +197,11 @@ module.exports = { | |||
194 | }, | 197 | }, |
195 | }, | 198 | }, |
196 | plugins: [ | 199 | plugins: [ |
200 | new DefinePlugin({ | ||
201 | 'DEBUG': JSON.stringify(devMode), | ||
202 | 'PACKAGE_NAME': JSON.stringify(packageInfo.name), | ||
203 | 'PACKAGE_VERSION': JSON.stringify(packageInfo.version), | ||
204 | }), | ||
197 | new MiniCssExtractPlugin({ | 205 | new MiniCssExtractPlugin({ |
198 | filename: '[name].[contenthash].css', | 206 | filename: '[name].[contenthash].css', |
199 | chunkFilename: '[name].[contenthash].css', | 207 | chunkFilename: '[name].[contenthash].css', |