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
Only add once for --watch mode #4
Labels
Comments
👍 |
Not super familar with webpack API, but I think we need to find the correct hook and then call compilation.emitAsset() in it (as opposed to mutating |
You can do this. const existingAsset = compilation.getAsset('assetName')
if(!existingAsset) {
compilation.emitAsset('assetName', source)
} |
Thanks. Maybe I'll incorporate that in #6 if input is a string (If it's a function, we need to emit every time). |
silverwind
added a commit
to silverwind/add-asset-webpack-plugin
that referenced
this issue
Nov 10, 2020
silverwind
added a commit
to silverwind/add-asset-webpack-plugin
that referenced
this issue
Nov 10, 2020
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When running
webpack --watch
with incremental compilations and with a staticstring
typesource
, the module will still add it on every incremental build which is useless and spams the log unneccesarily. Suggesting to emit astring
asset only once during--watch
. Function/Promise sources should of course be emitted every build because their content may change.The text was updated successfully, but these errors were encountered: