/
githubmirror
/
webpack
Обзор
Документация
Войти
/
githubmirror
/
webpack
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
test/configCases/plugins/dotenv-plugin/webpack.config.js
65 строк
1 KB
Alexander Akait
fix: ability to use built-in properties in dotenv and define plugin (#20168)
26 ноя 2025, 13:28
Не верифицирован
26 ноя 2025, 13:28
5ce84ec
Код
Авторство
О чём код?
"use strict"; const path = require("path"); /** @type {import("../../../../").Configuration[]} */ module.exports = [ // Test 1: Basic - default behavior with WEBPACK_ prefix { name: "basic", mode: "development", entry: "./basic.js", dotenv: true }, // Test 2: Expand - variables are always expanded { name: "expand", mode: "development", entry: "./expand.js", dotenv: true }, // Test 3: Custom dir - load from different directory { name: "custom-dir", mode: "development", entry: "./custom-envdir.js", dotenv: { dir: path.resolve(__dirname, "./envs") } }, // Test 4: Custom prefixes - multiple prefixes { name: "custom-prefixes", mode: "development", entry: "./custom-prefixes.js", dotenv: { dir: path.resolve(__dirname, "./prefixes-env"), prefix: ["APP_", "CONFIG_", "__proto__", "constructor"] } }, // Test 5: Mode-specific - .env.[mode] overrides { name: "mode-specific", mode: "production", entry: "./mode-specific.js", dotenv: true }, // Test 6: Disabled dir - dir: false disables .env file loading { name: "disabled-dir", mode: "development", entry: "./disabled-dir.js", dotenv: { dir: false } }, // Test 7: Custom template - load files based on custom template patterns { name: "custom-template", mode: "production", entry: "./custom-template.js", dotenv: { template: [".env", ".env.myLocal", ".env.[mode]", ".env.[mode].myLocal"] } } ];