-
-
Notifications
You must be signed in to change notification settings - Fork 380
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(ChunkExtractor): support publicPath override #292
feat(ChunkExtractor): support publicPath override #292
Conversation
This looks great, exactly what we were hoping for 👍 |
@BRKalow thank you for this PR! Could you please rebase and I will merge it. |
91e0136
to
259bd6e
Compare
@neoziro Done, thanks! |
Hi I think this is what I was looking for. My use case is that I call chunkExtractor.getCssString on a server at runtime to gather the critical CSS and inject it in the html before sending it to the browser. However, now, the output is incorrect therefore when getCssString tries to look for a css file, it didn't find it. Indeed, The outputPath on build time is not the same on runtime. @neoziro Can you confirm that chunkExtractor.getCssString relies on stats.outputPath to find the css ? If so, please publish a new release for the new feature Thank a lot |
@lauterry I believe |
Thx @BRKalow You're right. I'll give it a try. Sorry for the noise. I have confounded publicPath and outputPath |
Indeed, your proposition fixed my issue. Thx |
@BRKalow Hello, When you guys plan to release this to NPM ? It still gives us older version. Kindly update NPM if possible. Thanks. |
@sourabhkheterpal I believe this is included in |
Yes it is! |
@BRKalow This is awesome feature what i'm looking for currently. Added public path in chunk extractor but still js(chunk files) not loading from the runtime path which provided in publicPath.
|
Hi @srigar, I have the same issue, did you find a solution yet? Thanks for your help. |
Summary
Add support for passing
publicPath
toChunkExtractor
. This will allow consumers to overridepublicPath
at runtime.Currently in our usage we are loading the stats file, manually overriding the
publicPath
, and then injecting that stats object intoChunkExtractor
. This seems like a simple enough change that it warrants being supported out-of-the-box.Formatted docs section: https://deploy-preview-292--loadable.netlify.com/docs/server-side-rendering/#override-statspublicpath-at-runtime
closes #269
Test plan
Added new test cases to
packages/server/src/ChunkExtractor.test.js
.