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

Allow javascript modules to also have template literals minified #178

Merged
merged 7 commits into from Apr 10, 2022

Conversation

XsnTrcK
Copy link
Contributor

@XsnTrcK XsnTrcK commented Mar 15, 2022

At the moment due to defaults in meriyah's parse method javascript with import statements are not parsed causing the template literals to not be minified.

Updated parse call to always allow parsing of javascript with import statements

@XsnTrcK
Copy link
Contributor Author

XsnTrcK commented Mar 15, 2022

@maxmilton Thoughts?

@maxmilton
Copy link
Owner

maxmilton commented Mar 24, 2022

Sorry I've been travelling for a while and only just had a bit of time for my projects.

Looks good, however is there any notable downside to using module: true so modules are parsed all the time regardless? I suspect the performance overhead would be minimal anyway + less options is always nice.

@XsnTrcK
Copy link
Contributor Author

XsnTrcK commented Mar 24, 2022

Sorry I've been travelling for a while and only just had a bit of time for my projects.

Looks good, however is there any notable downside to using module: true so modules are parsed all the time regardless? I suspect the performance overhead would be minimal anyway + less options is always nice.

From my investigation doesn't look like there is any major noted downsides to setting module: true. Mainly added as a configuration in case it was intentional. Will update to just set module: true and revert changes to MinifyOptions and README

@XsnTrcK
Copy link
Contributor Author

XsnTrcK commented Mar 24, 2022

@maxmilton PR updated to just set module: true, remove unnecessary option, and add test to verify module javascript can be minified

Copy link
Owner

@maxmilton maxmilton left a comment

Choose a reason for hiding this comment

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

Looks good :)

src/index.ts Outdated Show resolved Hide resolved
@maxmilton maxmilton merged commit 0da1560 into maxmilton:master Apr 10, 2022
@maxmilton
Copy link
Owner

Sorry it took a while but your change has finally been publish in https://github.com/maxmilton/esbuild-minify-templates/releases/tag/v0.8.0

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.

None yet

2 participants