Skip to content
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

add minification step at prepublishOnly and test-ci #76

Merged
merged 6 commits into from
Jul 22, 2022

Conversation

iambumblehead
Copy link
Owner

@Swivelgames if you are available and would review this, please review

I tried two different esbuild minifier commands, because the main "--minifier" command broke esmock and caused the tests to fail.

  1. esbuild $filename --minify,
  2. esbuild $filename --minify-whitespace --minify-identifiers
name src --minify whitesp.
esmock.js 1498 731 750
esmockCache.js 888 427 463
esmockLoader.js 3708 1482 1626
esmockIsLoader.js 209 184 184
esmockModule.js 6883 2680 2911
total 13186 (13.2kB) 5504 (5.5kB) 5934 (5.9kB)

@iambumblehead
Copy link
Owner Author

The same version of node passes the same tests here as used by the failing CI tests. I'm not sure what causes this.

@iambumblehead
Copy link
Owner Author

I think the echo command is breaking the encoding

@iambumblehead
Copy link
Owner Author

I made a serious error storing the values in the variable first. I didn't find the esbuild option to allow over-writing to the source file so was trying to work around that. Fortunately, the ci tests are updated to test the minified sources and will catch this error if it happens in the future. iambumblehead/resolvewithplus#17

@iambumblehead
Copy link
Owner Author

> npx esbuild ./src/*[mj]s --minify --allow-overwrite  --outdir=src/


  src/esmockModule.js    2.6kb
  src/esmockLoader.js    1.4kb
  src/esmock.ode.js      743b 
  src/esmock.js          731b 
  src/esmockCache.js     427b 
  src/esmockIsLoader.js  184b 

⚡ Done in 3ms

this command works nicely, should work in windows and has a nice little summary

@iambumblehead
Copy link
Owner Author

I couldn't find a way to make esbuild process a set of files in windows. The minify commands here aren't nice but maybe they could be replaced later on.

@iambumblehead
Copy link
Owner Author

closes #71

@iambumblehead iambumblehead merged commit 696191d into master Jul 22, 2022
@iambumblehead iambumblehead deleted the add-minifer-step branch July 22, 2022 05:31
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.

2 participants