Add environment variable to control image inlining threshold#6060
Conversation
|
Can someone guide me in what's wrong with those two failing Travis builds? |
|
@Timer apart from the conflict, which I can fix, can you help me with the failing Travis test and a review? |
c1d1606 to
ca6f07e
Compare
|
This pull request has been automatically marked as stale because it has not had any recent activity. It will be closed in 5 days if no further activity occurs. |
|
This pull request has been automatically marked as stale because it has not had any recent activity. It will be closed in 5 days if no further activity occurs. |
…ble-inlining-images' into 3437-environment-variable-to-disable-inlining-images
…able-inlining-images 3437 environment variable to disable inlining images
|
I need this functionality, but the other way round, ie., I want everything to be base64 encoded. Would be good to see this get merged. Seems like the issues are arising due to a missing module? Error: [BABEL] /tmp/tmp.74WMXrb0ri/test-app-typescript/src/index.tsx: Cannot find module '@babel/plugin-transform-react-jsx-source' (While processing: "/tmp/tmp.74WMXrb0ri/test-app-typescript/node_modules/babel-preset-react-app/index.js$1") |
|
The corresponding issue #3437 has got some traction in the meanwhile, with different people saying that it is quite an issue for them due to CSP blocking @iansu I see you assigned yourself on this PR a while ago. Could you please tell us how we should proceed for this PR to be merged? What are the required steps? 🙏 |
|
Thanks @peterbe! |
Fixes #3437
I verified that this worked by editing the default application (
packages/react-scripts/template/src/App.js) to reference alogo.pngimage that I made up. The file was 5,237 bytes and when I ranyarn run buildthebuild/static/js/main.8204aa3b.chunk.jsdid contain the base64 string. Then, runningIMAGE_INLINE_SIZE_LIMIT=5000 yarn run buildthis time thebuild/static/js/main.499ec856.chunk.jsfile was -5.27KB and the filebuild/static/media/logo.adb700a2.pngexisted.