MCPcopy
hub / github.com/webpack/webpack / envToDefinitions

Function envToDefinitions

lib/DotenvPlugin.js:203–213  ·  lib/DotenvPlugin.js::envToDefinitions
(env)

Source from the content-addressed store, hash-verified

201 * @returns {Record<string, string>} formatted definitions
202 */
203const envToDefinitions = (env) => {
204 const definitions = /** @type {Record<string, string>} */ ({});
205
206 for (const [key, value] of Object.entries(env)) {
207 const defValue = JSON.stringify(value);
208 definitions[`process.env.${key}`] = defValue;
209 definitions[`import.meta.env.${key}`] = defValue;
210 }
211
212 return definitions;
213};
214
215class DotenvPlugin {
216 /**

Callers 1

applyMethod · 0.85

Calls 1

entriesMethod · 0.80

Tested by

no test coverage detected