webpack/test/configCases/plugins/dotenv-plugin/webpack.config.js

68 lines
1.0 KiB
JavaScript
Raw Normal View History

2025-09-13 15:01:49 +08:00
"use strict";
const DotenvPlugin = require("../../../../lib/DotenvPlugin");
/** @type {import("../../../../").Configuration[]} */
module.exports = [
{
name: "basic",
entry: "./basic",
plugins: [new DotenvPlugin()]
},
{
name: "with-defaults",
entry: "./defaults",
plugins: [
new DotenvPlugin({
defaults: true
})
]
},
{
name: "with-expand",
entry: "./expand",
plugins: [
new DotenvPlugin({
expand: true
})
]
},
{
name: "with-systemvars",
entry: "./systemvars",
plugins: [
new DotenvPlugin({
systemvars: true
})
]
},
{
name: "custom-path",
entry: "./custom-path",
plugins: [
new DotenvPlugin({
path: "./.env.example"
})
]
},
{
name: "custom-prefix",
entry: "./custom-prefix",
plugins: [
new DotenvPlugin({
prefix: "MY_ENV."
})
]
},
{
name: "safe-mode-error",
entry: "./basic", // Use existing entry file
plugins: [
new DotenvPlugin({
path: "./incomplete.env",
safe: "./.env.example"
})
]
}
];