Title: React JS - Before Dev and Build get and pass props to App
Tags: javascript;node.js;reactjs;build
Question: I would like to have static assets and props in my App. In the build I want to have some image assets set with a bas64 string. I think I should get those assets to the App's props on before Dev and Build. (just like you would with Gatsby.js).
So my question would be: &quot;How to set props to the Ap pre Start and Build.&quot;
Is there an out of the box solution for? Or is there an other way.
Comment: That seems promising. `webpack.config.js` does not seem to get loaded by my install though. Nice pointer. First I would have to get the config to be detected :)

Comment: You're probably looking for a Webpack plugin that loads images as base64 strings, then you can simply do `import imageURL from "/assets/image.png";` and work with that string in your app.

Comment: https://v4.webpack.js.org/loaders/url-loader/

Here is the accepted answer: Default value of IMAGE_INLINE_SIZE_LIMIT is 10000 which means by default, images smaller than 10,000 bytes are encoded as a data URI in base64 and inlined in the CSS or JS build artifact. Set this to control the size limit in bytes.
Setting it to 0 will disable the inlining of images.
Create file .env.production at the root of project directory and set IMAGE_INLINE_SIZE_LIMIT greater then 10000. React will convert the images to Base64 when your app starts to build.
Note: The more you increase the IMAGE_INLINE_SIZE_LIMIT will also increase the chunk js file size
Here you can check the Advanced Configuration


{'source': 'StackExchangeDataset', 'subset': 'stackoverflow.com', 'metadata': {'AnswerCount': 1, 'CommentCount': 3, 'ContentLicense': 'CC BY-SA 4.0', 'CreationDate': '2021:00:05/31/21', 'FavoriteCount': None, 'PostTypeId': 1, 'Tags': '<javascript><node.js><reactjs><build>', 'Title': 'React JS - Before Dev and Build get and pass props to App', 'ViewCount': 309, 'id': 67769310, 'user_AboutMe': None, 'user_AccountId': 9849106.0, 'user_DisplayName': 'Tim', 'user_Reputation': 801.0, 'user_Views': 155.0, 'user_id': 7295693.0}}