From 686c0e854fceb928fe7b313c8fec0c19a5121938 Mon Sep 17 00:00:00 2001 From: Matt Gibson Date: Mon, 26 Jul 2021 08:51:25 -0500 Subject: [PATCH] Set env with EnvironmentPlugin (#1097) * Set env with EnvironmentPlugin * Remove stringify EnvironmentPlugin applies stringify itself. --- webpack.config.js | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/webpack.config.js b/webpack.config.js index 718cd75eb8..03c764fdb5 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -137,14 +137,12 @@ const plugins = [ filename: '[name].[hash].css', chunkFilename: '[id].[hash].css', }), - new webpack.DefinePlugin({ - 'process.env': { - 'ENV': JSON.stringify(ENV), - 'NODE_ENV': NODE_ENV === 'production' ? 'production' : 'development', - 'SELF_HOST': JSON.stringify(process.env.SELF_HOST === 'true' ? true : false), - 'APPLICATION_VERSION': JSON.stringify(pjson.version), - 'CACHE_TAG': JSON.stringify(Math.random().toString(36).substring(7)), - } + new webpack.EnvironmentPlugin({ + 'ENV': ENV, + 'NODE_ENV': NODE_ENV === 'production' ? 'production' : 'development', + 'SELF_HOST': process.env.SELF_HOST === 'true' ? true : false, + 'APPLICATION_VERSION': pjson.version, + 'CACHE_TAG': Math.random().toString(36).substring(7), }), new AngularCompilerPlugin({ tsConfigPath: 'tsconfig.json',