Skip to content

Commit e2c09ca

Browse files
committed
Rename whitelist to allowList
1 parent 6062554 commit e2c09ca

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Gatsby Environment Variables Plugin
22

3-
> A [Gatsby](https://github.com/gatsbyjs/gatsby) plugin to whitelist system environment variables to be made available to client-side scripts.
3+
> A [Gatsby](https://github.com/gatsbyjs/gatsby) plugin to allow system environment variables to be made available to client-side scripts.
44
55
By default, Gatsby only makes system environment variables [prefixed with `GATSBY_`](https://www.gatsbyjs.org/docs/environment-variables/#accessing-environment-variables-in-javascript) available to client scripts. Using this plugin, you can make any arbitrary environment variable available at runtime.
66

@@ -20,7 +20,7 @@ module.exports = {
2020
{
2121
resolve: `gatsby-plugin-env-variables`,
2222
options: {
23-
whitelist: ["MY_VAR", "MY_OTHER_VAR"]
23+
allowList: ["MY_VAR", "MY_OTHER_VAR"]
2424
},
2525
},
2626
],

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "gatsby-plugin-env-variables",
3-
"version": "1.0.2",
4-
"description": "Gatsby plugin to whitelist system environment variables to be made available to client-side scripts",
3+
"version": "2.0.0",
4+
"description": "Gatsby plugin to allow system environment variables to be made available to client-side scripts",
55
"keywords": [
66
"gatsby",
77
"gatsby-plugin",

src/gatsby-node.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
exports.onCreateWebpackConfig = ({ actions, plugins }, options) => {
2-
const { whitelist } = options || {};
2+
const { allowList } = options || {};
33

4-
if (!whitelist) return;
4+
if (!allowList) return;
55

66
const varobj = Object.keys(process.env).reduce((acc, key) => {
7-
if (whitelist.indexOf(key) >= 0) {
7+
if (allowList.indexOf(key) >= 0) {
88
acc[`process.env.${key}`] = JSON.stringify(process.env[key]);
99
}
1010
return acc;

0 commit comments

Comments
 (0)