From 20a5372e1239bf3d0c59d9d20a4c7caa85c863ca Mon Sep 17 00:00:00 2001 From: John Livingston Date: Mon, 12 Apr 2021 15:08:05 +0200 Subject: [PATCH] Adding PLUGIN_CHAT_PACKAGE_NAME --- client/@types/global.d.ts | 1 + webpack.config.js | 14 +++++++++++--- 2 files changed, 12 insertions(+), 3 deletions(-) create mode 100644 client/@types/global.d.ts diff --git a/client/@types/global.d.ts b/client/@types/global.d.ts new file mode 100644 index 00000000..77464e6d --- /dev/null +++ b/client/@types/global.d.ts @@ -0,0 +1 @@ +declare const PLUGIN_CHAT_PACKAGE_NAME: string diff --git a/webpack.config.js b/webpack.config.js index eef992b3..eceb5aea 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -1,6 +1,9 @@ -const path = require("path") +const path = require('path') +const webpack = require('webpack') -const EsmWebpackPlugin = require("@purtuga/esm-webpack-plugin") +const EsmWebpackPlugin = require('@purtuga/esm-webpack-plugin') + +const packagejson = require('./package.json') const clientFiles = [ 'common-client-plugin', @@ -27,7 +30,12 @@ let config = clientFiles.map(f => ({ library: "script", libraryTarget: "var" }, - plugins: [ new EsmWebpackPlugin() ] + plugins: [ + new webpack.DefinePlugin({ + PLUGIN_CHAT_PACKAGE_NAME: JSON.stringify(packagejson.name) + }), + new EsmWebpackPlugin() + ] })) config.push({