From ccbb4f42f05beb5302e0a97ec2d51182ad89b7fc Mon Sep 17 00:00:00 2001 From: Pig Fang Date: Wed, 15 Jun 2022 14:16:37 +0800 Subject: [PATCH] expose React globals fix bs-community/blessing-skin-plugins#145 --- webpack.config.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/webpack.config.ts b/webpack.config.ts index 29cfc16e..09a853cd 100644 --- a/webpack.config.ts +++ b/webpack.config.ts @@ -129,6 +129,15 @@ export default function (env?: Env): webpack.Configuration[] { assert: false, }, }, + externals: Object.assign( + { jquery: 'jQuery', bootstrap: 'bootstrap', 'admin-lte': 'adminlte' }, + isDev + ? {} + : { + react: 'React', + 'react-dom': 'ReactDOM', + }, + ) as Record, optimization: { // @ts-ignore minimizer: [new CssMinimizerPlugin({}), '...'],