Skip to content

Commit

Permalink
Added ts-transformer-minify-privates to minify private members of cla…
Browse files Browse the repository at this point in the history
…sses
  • Loading branch information
timocov committed Jun 10, 2019
1 parent f4c031d commit 9454d57
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 5 deletions.
12 changes: 7 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,22 +47,24 @@
"rollup-plugin-replace": "~2.2.0",
"rollup-plugin-terser": "~5.0.0",
"ts-node": "~8.2.0",
"ts-transformer-minify-privates": "~0.1.0",
"tslib": "1.9.3",
"tslint": "5.17.0",
"tslint-eslint-rules": "~5.4.0",
"tslint-microsoft-contrib": "~6.2.0",
"ttypescript": "~1.5.7",
"typescript": "3.5.1",
"vrsource-tslint-rules": "6.0.0"
},
"scripts": {
"install": "npm run install-hooks && cd tests/e2e && npm i",
"install-hooks": "node scripts/githooks/install.js",
"clean": "rimraf lib/ dist/",
"bundle-dts": "tsc --noEmit --allowJs dts-config.js && dts-bundle-generator --config dts-config.js",
"tsc": "tsc -b src",
"tsc-watch": "tsc -b --watch --preserveWatchOutput",
"tsc-all": "tsc -b .",
"tsc-all-watch": "tsc -b . --watch --preserveWatchOutput",
"bundle-dts": "ttsc --noEmit --allowJs dts-config.js && dts-bundle-generator --config dts-config.js",
"tsc": "ttsc -b src",
"tsc-watch": "ttsc -b --watch --preserveWatchOutput",
"tsc-all": "ttsc -b .",
"tsc-all-watch": "ttsc -b . --watch --preserveWatchOutput",
"lint": "npm-run-all -p lint:**",
"lint:eslint": "eslint --format=unix --ext .js ./",
"lint:tslint": "tslint --config tslint.json --project tsconfig.all-non-composite.json",
Expand Down
6 changes: 6 additions & 0 deletions rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,12 @@ function getConfig(inputFile, type, isProd) {
comments: /@license/,
inline_script: true,
},
mangle: {
module: (type === 'module'),
properties: {
regex: /^_private_/,
},
},
}),
],
};
Expand Down
5 changes: 5 additions & 0 deletions tsconfig.base.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@
"noImplicitReturns": true,
"noUnusedLocals": true,
"outDir": "lib",
"plugins": [
{
"transform": "ts-transformer-minify-privates"
}
],
"preserveConstEnums": true,
"resolveJsonModule": true,
"rootDir": "./",
Expand Down

0 comments on commit 9454d57

Please sign in to comment.