Skip to content

Commit 2cf298a

Browse files
authored
Allow IMJS_URL_PREFIX to be configured at runtime (#70)
1 parent ffc0afb commit 2cf298a

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

packages/react-scripts/config/webpack.config.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,10 @@ module.exports = function (webpackEnv) {
136136

137137
const shouldUseReactRefresh = env.raw.FAST_REFRESH;
138138

139+
if (env.raw.IMJS_URL_PREFIX === undefined) {
140+
env.stringified["process.env"].IMJS_URL_PREFIX = `(globalThis.IMJS_URL_PREFIX ?? "")`;
141+
}
142+
139143
// common function to get style loaders
140144
const getStyleLoaders = (cssOptions, preProcessor) => {
141145
const loaders = [

packages/react-scripts/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@bentley/react-scripts",
3-
"version": "4.0.5",
3+
"version": "4.0.6",
44
"description": "iModel.js configuration and scripts for Create React App.",
55
"repository": {
66
"type": "git",

0 commit comments

Comments
 (0)