forked from nrwl/webpack-plugin-critical
-
Notifications
You must be signed in to change notification settings - Fork 38
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
Have HtmlCriticalWebpack contribute critical's changes back to the compilation #27
Labels
Comments
thescientist13
changed the title
Have HtmlCriticalWebpack contribute critical changes back to the compilation
Have HtmlCriticalWebpack contribute critical's changes back to the compilation
Jun 27, 2018
This would definitely be an improvement if it can be achieved. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Summary
Currently, this plugin wraps critical so that it can be called as part of a webpack build lifecycle. By design though, critical only reads and writes to the filesystem. In this way, HtmlCriticalWebpackPlugin acts more in a capacity of that of a post-build step / action.
Per the discussion in #21, and that this plugin assumes the presence of HtmlWebpackPlugin, it might be a nice touch if this plugin could get the result of calling critical, and apply that change to the compilation directly instead, but without any filesystem I / O.
Benefits
Initial Thoughts
critical's API expects an entry point file and so (without having looked at it) I'm not sure how that would work with how webpack manages the compilation (bundled assets) in memory; be it AST, string, Buffer, something else?. Same thing for the output file I imagine.
I think it might come down to being able to tap into critical's API enough to be able to get all its business logic, but without the I/O. 🤔
The text was updated successfully, but these errors were encountered: