dotenv-webpack 7.1.0 → 7.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +11 -13
- package/dist/index.js +5 -3
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
<h1>
|
|
2
|
+
<img width="30" height="30" src="https://raw.githubusercontent.com/motdotla/dotenv/master/dotenv.png" alt="dotenv" />
|
|
3
|
+
<img width="30" height="30" src="https://webpack.js.org/assets/icon-square-big.svg" alt="webpack">
|
|
4
|
+
dotenv-webpack
|
|
5
|
+
</h1>
|
|
6
|
+
|
|
3
7
|
A secure webpack plugin that supports dotenv and other environment variables and **only exposes what you choose and use**.
|
|
4
8
|
|
|
5
9
|
<div align="center">
|
|
@@ -12,18 +16,10 @@ A secure webpack plugin that supports dotenv and other environment variables and
|
|
|
12
16
|
<a href="https://github.com/mrsteele/dotenv-webpack/actions/workflows/main.yml" target="_blank">
|
|
13
17
|
<img alt="Main" src="https://github.com/mrsteele/dotenv-webpack/actions/workflows/main.yml/badge.svg" />
|
|
14
18
|
</a>
|
|
15
|
-
<
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
<a href="https://david-dm.org/mrsteele/dotenv-webpack?type=dev" target="_blank">
|
|
19
|
-
<img alt="devDependency Status" src="https://david-dm.org/mrsteele/dotenv-webpack/dev-status.svg" />
|
|
19
|
+
<object id="badge" data="https://snyk-widget.herokuapp.com/badge/npm/dotenv-webpack/badge.svg" type="image/svg+xml"></object>
|
|
20
|
+
<a href="https://www.dotenv.org/get-started?r=3" target="_blank">
|
|
21
|
+
<img alt="dotenv-vault" src="https://badge.dotenv.org/works-with.svg?r=3" />
|
|
20
22
|
</a>
|
|
21
|
-
|
|
22
|
-
<h1>
|
|
23
|
-
<img width="30" height="30" src="https://raw.githubusercontent.com/motdotla/dotenv/master/dotenv.png" alt="dotenv" />
|
|
24
|
-
<img width="30" height="30" src="https://webpack.js.org/assets/icon-square-big.svg" alt="webpack">
|
|
25
|
-
dotenv-webpack
|
|
26
|
-
</h1>
|
|
27
23
|
</div>
|
|
28
24
|
|
|
29
25
|
## Installation
|
|
@@ -38,6 +34,8 @@ Include the package locally in your repository.
|
|
|
38
34
|
|
|
39
35
|
Your `.env` files can include sensitive information. Because of this,`dotenv-webpack` will only expose environment variables that are **explicitly referenced in your code** to your final bundle.
|
|
40
36
|
|
|
37
|
+
Interested in taking your environments to the next level? Check out the [Dotenv Organization](https://www.dotenv.org/get-started?r=3).
|
|
38
|
+
|
|
41
39
|
## Usage
|
|
42
40
|
|
|
43
41
|
The plugin can be installed with little-to-no configuration needed. Once installed, you can access the variables within your code using `process.env` as you would with `dotenv`.
|
package/dist/index.js
CHANGED
|
@@ -17,7 +17,7 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
|
|
|
17
17
|
|
|
18
18
|
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
19
19
|
|
|
20
|
-
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
|
20
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
21
21
|
|
|
22
22
|
// Mostly taken from here: https://github.com/motdotla/dotenv-expand/blob/master/lib/main.js#L4
|
|
23
23
|
var interpolate = function interpolate(env, vars) {
|
|
@@ -219,8 +219,10 @@ var Dotenv = /*#__PURE__*/function () {
|
|
|
219
219
|
return targets.every(function (target) {
|
|
220
220
|
return (// If configured prefix is 'process.env'
|
|
221
221
|
_this.config.prefix === 'process.env.' && // If we're not configured to never stub
|
|
222
|
-
_this.config.ignoreStub !== true && ( //
|
|
223
|
-
|
|
222
|
+
_this.config.ignoreStub !== true && ( // And
|
|
223
|
+
// We are configured to always stub
|
|
224
|
+
_this.config.ignoreStub === false || // Or if we should according to the target
|
|
225
|
+
!target.includes('node') && !isMainThreadElectron(target))
|
|
224
226
|
);
|
|
225
227
|
});
|
|
226
228
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dotenv-webpack",
|
|
3
3
|
"description": "A simple webpack plugin to support dotenv.",
|
|
4
|
-
"version": "7.1.
|
|
4
|
+
"version": "7.1.1",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"precommit": "npm run lint",
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
"@babel/register": "^7.13.8",
|
|
61
61
|
"husky": "^7.0.1",
|
|
62
62
|
"jest": "^27.0.4",
|
|
63
|
-
"jsdoc": "^3.6.
|
|
63
|
+
"jsdoc": "^3.6.10",
|
|
64
64
|
"rimraf": "^3.0.0",
|
|
65
65
|
"sinon": "^11.1.1",
|
|
66
66
|
"standard": "^16.0.3",
|