Skip to content

Commit 5c8392f

Browse files
authored
Update README.md
1 parent 96b685f commit 5c8392f

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

README.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
[![npm version][npm-version-img]][npm-link]
55
[![Downloads][npm-downloads-img]][npm-link]
66

7-
A TypeScript custom transformer which reduces bundle size (with a help of other tools in your bundler - see below) by renaming properties aren't exposed to the public:
7+
A TypeScript custom transformer which reduces bundle size (with a help of other tools in your bundler - [see below](#how-to-minify-properties)) by renaming properties aren't exposed to the public:
88

99
```typescript
1010
function showMessage(opts: { message: string }): void {
@@ -19,16 +19,14 @@ goes to:
1919

2020
```javascript
2121
function showMessage(opts) {
22-
alert(opts._internal_message);
22+
alert(opts._internal_message); // `_internal_message` will be like just `s` after terser/uglify
2323
}
2424
function alertMessage(message) {
25-
showMessage({ _internal_message: message });
25+
showMessage({ _internal_message: message }); // `_internal_message` will be like just `s` after terser/uglify
2626
}
2727
exports.alertMessage = alertMessage;
2828
```
2929

30-
_(note that terser/uglify/any other minifier [will rename `_internal_message` property](#how-to-minify-properties) to something like just `s`)_
31-
3230
You might find the approach pretty similar to how Google Closure Compiler with enabled advanced optimizations works,
3331
but you don't need to refactor your project a lot to make it works for Google Closure Compiler (setting up [tsickle](https://github.com/angular/tsickle) might be hard as well).
3432

0 commit comments

Comments
 (0)