Skip to content

Commit

Permalink
feat(build): enhance code obfuscation in minification process
Browse files Browse the repository at this point in the history
- Enable top-level symbol mangling
- Add property name mangling with selective rules
- Preserve 'parseTemplateString' function name and quoted properties

This change increases code protection while maintaining the public API.
The resulting minified file should be significantly smaller and harder
to reverse-engineer, without affecting its functionality.
  • Loading branch information
getCurrentThread committed Sep 11, 2024
1 parent c079d75 commit 8c071b5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
run: |
npx terser safe-template-parser.js \
--compress passes=3,pure_getters=true,keep_fargs=false,unsafe=true,unsafe_comps=true,unsafe_math=true,unsafe_proto=true,unsafe_regexp=true,conditionals=true,evaluate=true,booleans=true,loops=true,unused=true,hoist_funs=true,keep_fargs=false,hoist_vars=true,if_return=true,join_vars=true,drop_console=true,drop_debugger=true,ecma=2015,toplevel=true \
--mangle reserved=['parseTemplateString'] \
--mangle reserved=['parseTemplateString'],toplevel=true,properties --mangle-props keep_quoted=true,regex=/^_/ \
--output safe-template-parser.min.js
- name: Calculate file sizes
Expand Down

0 comments on commit 8c071b5

Please sign in to comment.