From 2b0025af35bd8ac00b963c7fe27232aafddbc6f3 Mon Sep 17 00:00:00 2001 From: Franck Freiburger Date: Tue, 30 Oct 2018 16:11:33 +0100 Subject: [PATCH] add module argument to DefinePlugin.runtimeValue functions PR #6793 added the ability for DefinePlugin to use function that return values. This PR just add the ability to these functions to access the module being parsed (see #8301). eg. ``` webpack.DefinePlugin.runtimeValue(module => module.resource ....) ``` --- lib/DefinePlugin.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/DefinePlugin.js b/lib/DefinePlugin.js index 7f0d1107fa4..d0865b2dedf 100644 --- a/lib/DefinePlugin.js +++ b/lib/DefinePlugin.js @@ -29,7 +29,7 @@ class RuntimeValue { } } - return this.fn(); + return this.fn(parser.state.module); } }