Skip to content

Minify once, after wrapping in function#14

Open
rjmunro wants to merge 2 commits intomrcoles:masterfrom
rjmunro:feature/minify-once
Open

Minify once, after wrapping in function#14
rjmunro wants to merge 2 commits intomrcoles:masterfrom
rjmunro:feature/minify-once

Conversation

@rjmunro
Copy link
Copy Markdown

@rjmunro rjmunro commented Jun 18, 2020

This means the minifier can do a better job because it knows it is safe to mangle variable and function names etc.

@mrcoles
Copy link
Copy Markdown
Owner

mrcoles commented Mar 28, 2021

@rjmunro feel free to update based on the latest changes!

This means the minifier can do a better job because it knows it is safe
to mangle variable and function names etc.
@rjmunro rjmunro force-pushed the feature/minify-once branch from 203c21d to af2fbe6 Compare March 29, 2021 08:28
@rjmunro
Copy link
Copy Markdown
Author

rjmunro commented Mar 29, 2021

Updated. I've updated the tests, but I'm not sure how to actually run them to ensure they still work.

}

code = `(function(){${code}})()`;
code = await minify(`(function(){${code}})()`);
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minify the whole IIFE produces unexpected result.

You can test the generated output by

./bin/cli.js test/bookmarklets/test1.bookmarklet.js -d > o1.html

then open the file and click the Test button within.

In this commit the result is a true appear, while the expected result should be an alert.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants