(env)
| 201 | * @returns {Record<string, string>} formatted definitions |
| 202 | */ |
| 203 | const 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 | |
| 215 | class DotenvPlugin { |
| 216 | /** |