From 86132d649b13fd333c970a96cbbf5c6714984d93 Mon Sep 17 00:00:00 2001 From: piotr-suwala <112620304+piotr-suwala@users.noreply.github.com> Date: Mon, 9 Oct 2023 15:22:31 +0200 Subject: [PATCH] feat(lib): read .env for web (#136) --- samples/react-native-group-chat/babel.config.js | 11 ++++++++++- samples/react-native-group-chat/package.json | 1 + yarn.lock | 10 +++++----- 3 files changed, 16 insertions(+), 6 deletions(-) diff --git a/samples/react-native-group-chat/babel.config.js b/samples/react-native-group-chat/babel.config.js index 53b18f4..c905651 100644 --- a/samples/react-native-group-chat/babel.config.js +++ b/samples/react-native-group-chat/babel.config.js @@ -2,6 +2,15 @@ module.exports = function (api) { api.cache(true) return { presets: ["babel-preset-expo"], - plugins: ["@babel/plugin-proposal-export-namespace-from", "react-native-reanimated/plugin"], + plugins: [ + "@babel/plugin-proposal-export-namespace-from", + "react-native-reanimated/plugin", + [ + "transform-inline-environment-variables", + { + include: ["EXPO_PUBLIC_PUBNUB_SUB_KEY", "EXPO_PUBLIC_PUBNUB_PUB_KEY"], + }, + ], + ], } } diff --git a/samples/react-native-group-chat/package.json b/samples/react-native-group-chat/package.json index e881d3d..95e26a8 100644 --- a/samples/react-native-group-chat/package.json +++ b/samples/react-native-group-chat/package.json @@ -46,6 +46,7 @@ "@svgr/webpack": "^8.1.0", "@types/react": "~18.0.14", "babel-plugin-inline-react-svg": "^2.0.2", + "babel-plugin-transform-inline-environment-variables": "^0.4.4", "react-native-svg-transformer": "^1.1.0", "typescript": "^5.1.3" }, diff --git a/yarn.lock b/yarn.lock index af50fd4..68826fb 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4049,6 +4049,11 @@ babel-plugin-transform-flow-enums@^0.0.2: dependencies: "@babel/plugin-syntax-flow" "^7.12.1" +babel-plugin-transform-inline-environment-variables@^0.4.4: + version "0.4.4" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-inline-environment-variables/-/babel-plugin-transform-inline-environment-variables-0.4.4.tgz#974245008b3cbbd646bd81707af147aea3acca43" + integrity sha512-bJILBtn5a11SmtR2j/3mBOjX4K3weC6cq+NNZ7hG22wCAqpc3qtj/iN7dSe9HDiS46lgp1nHsQgeYrea/RUe+g== + babel-preset-current-node-syntax@^1.0.0: version "1.0.1" resolved "https://registry.npmjs.org/babel-preset-current-node-syntax/-/babel-preset-current-node-syntax-1.0.1.tgz" @@ -9122,11 +9127,6 @@ mkdirp@^1.0.3, mkdirp@^1.0.4: resolved "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz" integrity sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw== -mock-fs@^5.2.0: - version "5.2.0" - resolved "https://registry.npmjs.org/mock-fs/-/mock-fs-5.2.0.tgz" - integrity sha512-2dF2R6YMSZbpip1V1WHKGLNjr/k48uQClqMVb5H3MOvwc9qhYis3/IWbj02qIg/Y8MDXKFF4c5v0rxx2o6xTZw== - ms@2.0.0: version "2.0.0" resolved "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz"