You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+3-5Lines changed: 3 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@
4
4
[![npm version][npm-version-img]][npm-link]
5
5
[![Downloads][npm-downloads-img]][npm-link]
6
6
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:
8
8
9
9
```typescript
10
10
function showMessage(opts: { message:string }):void {
@@ -19,16 +19,14 @@ goes to:
19
19
20
20
```javascript
21
21
functionshowMessage(opts) {
22
-
alert(opts._internal_message);
22
+
alert(opts._internal_message);// `_internal_message` will be like just `s` after terser/uglify
23
23
}
24
24
functionalertMessage(message) {
25
-
showMessage({ _internal_message: message });
25
+
showMessage({ _internal_message: message });// `_internal_message` will be like just `s` after terser/uglify
26
26
}
27
27
exports.alertMessage= alertMessage;
28
28
```
29
29
30
-
_(note that terser/uglify/any other minifier [will rename `_internal_message` property](#how-to-minify-properties) to something like just `s`)_
31
-
32
30
You might find the approach pretty similar to how Google Closure Compiler with enabled advanced optimizations works,
33
31
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).
0 commit comments