-
Notifications
You must be signed in to change notification settings - Fork 3
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
move common logic to size-plugin-core & add support for size-plugin bot #4
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome! LGTM
@luwes it seems to work on my end. can you share the repo where you are trying? |
@kuldeepkeshwar it's because Maybe better go back to This is the repo: https://github.com/luwes/sinuous-todomvc |
or maybe |
@luwes handled both cases(dir/file) |
@luwes this is bit tricky, I will come back on it |
@luwes you can use the bundleSize({exclude:'!bundle.js'}) Note: delta not only includes the files which are created/updated in the current build but it also includes the files which are deleted in the current build & to do so plugin needs to consider all files in the directory to figure out which files are deleted in the current build. |
very cool, will test this soon |
@kuldeepkeshwar this looks good, only the output has to be only the current build. what's the use case of wanting to see a fully deleted build file? |
@luwes it should only show the delta(addition/modification/deletion). Can you please share a repo link, I would like to dig it deeper |
@luwes help me close this. |
@kuldeepkeshwar sorry for the late response. can I be of help to get the output issue fixed? it has to be included before we can merge this PR. it's the luwes/sinuous repo. |
@luwes I have fixed it. Needed to handle the case of the single output file separately. |
Awesome! almost there, could you just add these changes? diff --git a/rollup-plugin-size.js b/rollup-plugin-size.js
index 839adc4..9afbf06 100644
--- a/rollup-plugin-size.js
+++ b/rollup-plugin-size.js
@@ -20,11 +20,11 @@ const defaults = {
* @param {boolean} [options.publish] option to publish filesizes to size-plugin-store
* @param {boolean} [options.writeFile] option to save filesizes to disk
*/
-function bundleSize(_options) {
- const coreOptions = Object.assign(defaults, _options);
+function bundleSize(options) {
+ const coreOptions = Object.assign(defaults, options);
coreOptions.compression = coreOptions.brotli ? 'brotli' : 'gzip';
- const core = new SizePluginCore(_options);
+ const core = new SizePluginCore(coreOptions);
async function generateBundle(outputOptions, bundle) {
try {
const assets = Object.keys(bundle).reduce((agg, key) => { |
could I also be added as maintainer to https://github.com/kuldeepkeshwar/size-plugin-core? |
@luwes updated the variable names. Regarding the spacing,
yes, just create a pull request. I will add you. |
Awesome thanks! Great work 💪 |
I have created a bot, which comments the sizes of the assets and the changes since the last build into the relevant PR
Support for the bot is already added to the webpack's size-plugin here
Summarizing the changes: