From 1140d8288093284193bc8a64799aa3ff645bf93e Mon Sep 17 00:00:00 2001 From: ahabhgk Date: Tue, 19 Mar 2024 13:59:56 +0800 Subject: [PATCH] fix webpack4 --- src/index.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/index.js b/src/index.js index 0242a62..7a68e27 100644 --- a/src/index.js +++ b/src/index.js @@ -45,8 +45,9 @@ class Dotenv { target, version }) + const DefinePlugin = (compiler.webpack && compiler.webpack.DefinePlugin) || require('webpack').DefinePlugin - new compiler.webpack.DefinePlugin(data).apply(compiler) + new DefinePlugin(data).apply(compiler) } gatherVariables () {