Skip to content

Commit 9454d57

Browse files
committed
Added ts-transformer-minify-privates to minify private members of classes
1 parent f4c031d commit 9454d57

3 files changed

Lines changed: 18 additions & 5 deletions

File tree

package.json

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,22 +47,24 @@
4747
"rollup-plugin-replace": "~2.2.0",
4848
"rollup-plugin-terser": "~5.0.0",
4949
"ts-node": "~8.2.0",
50+
"ts-transformer-minify-privates": "~0.1.0",
5051
"tslib": "1.9.3",
5152
"tslint": "5.17.0",
5253
"tslint-eslint-rules": "~5.4.0",
5354
"tslint-microsoft-contrib": "~6.2.0",
55+
"ttypescript": "~1.5.7",
5456
"typescript": "3.5.1",
5557
"vrsource-tslint-rules": "6.0.0"
5658
},
5759
"scripts": {
5860
"install": "npm run install-hooks && cd tests/e2e && npm i",
5961
"install-hooks": "node scripts/githooks/install.js",
6062
"clean": "rimraf lib/ dist/",
61-
"bundle-dts": "tsc --noEmit --allowJs dts-config.js && dts-bundle-generator --config dts-config.js",
62-
"tsc": "tsc -b src",
63-
"tsc-watch": "tsc -b --watch --preserveWatchOutput",
64-
"tsc-all": "tsc -b .",
65-
"tsc-all-watch": "tsc -b . --watch --preserveWatchOutput",
63+
"bundle-dts": "ttsc --noEmit --allowJs dts-config.js && dts-bundle-generator --config dts-config.js",
64+
"tsc": "ttsc -b src",
65+
"tsc-watch": "ttsc -b --watch --preserveWatchOutput",
66+
"tsc-all": "ttsc -b .",
67+
"tsc-all-watch": "ttsc -b . --watch --preserveWatchOutput",
6668
"lint": "npm-run-all -p lint:**",
6769
"lint:eslint": "eslint --format=unix --ext .js ./",
6870
"lint:tslint": "tslint --config tslint.json --project tsconfig.all-non-composite.json",

rollup.config.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,12 @@ function getConfig(inputFile, type, isProd) {
4646
comments: /@license/,
4747
inline_script: true,
4848
},
49+
mangle: {
50+
module: (type === 'module'),
51+
properties: {
52+
regex: /^_private_/,
53+
},
54+
},
4955
}),
5056
],
5157
};

tsconfig.base.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,11 @@
1919
"noImplicitReturns": true,
2020
"noUnusedLocals": true,
2121
"outDir": "lib",
22+
"plugins": [
23+
{
24+
"transform": "ts-transformer-minify-privates"
25+
}
26+
],
2227
"preserveConstEnums": true,
2328
"resolveJsonModule": true,
2429
"rootDir": "./",

0 commit comments

Comments
 (0)