You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Which is okay, but, there are two problems with this approach overall:
Based on tribal knowledge, you either know where to look or you don't. It's not obvious at all because you would ideally not need to look at the built files.
Depends on an implementation detail that can break across different versions of react-scripts
Possible solution:
One possible way to enable a better developer experience (DX) is to read the manifest file and pass those files from that to bundlesize. For create-react-app, that's build/asset-manifest.json.
You'll still need to ask for the maxSize but instead of globs, it can be in terms of main and chunk (or page1, page2 depending on the tool)
This probably should not be in the core, but instead in a plugin (see discussion about plugin system in <#placeholder>)
Note: Replace create-react-app with nextjs and you have another feature request
The text was updated successfully, but these errors were encountered:
Problem
As a create-react-app / nexstjs / gatsby user, you don't know the name of the build files ahead of time.
You can use bundlesize's glob matching to get files
which matches an unknown number of files:
41.58 KB build/static/js/1.238fbfd9.chunk.js 2.36 KB build/static/js/main.4ba9e49b.chunk.js 1.53 KB build/static/css/main.9663333b.chunk.css 763 B build/static/js/runtime~main.229c360f.js
This can be fine tuned by a bundlesize config:
Which is okay, but, there are two problems with this approach overall:
Based on tribal knowledge, you either know where to look or you don't. It's not obvious at all because you would ideally not need to look at the built files.
Depends on an implementation detail that can break across different versions of
react-scripts
Possible solution:
One possible way to enable a better developer experience (DX) is to read the manifest file and pass those files from that to bundlesize. For create-react-app, that's
build/asset-manifest.json
.You'll still need to ask for the
maxSize
but instead of globs, it can be in terms ofmain
andchunk
(orpage1
,page2
depending on the tool)This probably should not be in the core, but instead in a plugin (see discussion about plugin system in <#placeholder>)
Note: Replace create-react-app with nextjs and you have another feature request
The text was updated successfully, but these errors were encountered: