diff --git a/package.json b/package.json index d8d7906f43..29fed4ad05 100644 --- a/package.json +++ b/package.json @@ -47,10 +47,12 @@ "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" }, @@ -58,11 +60,11 @@ "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", diff --git a/rollup.config.js b/rollup.config.js index 4908907128..04a4b204e5 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -46,6 +46,12 @@ function getConfig(inputFile, type, isProd) { comments: /@license/, inline_script: true, }, + mangle: { + module: (type === 'module'), + properties: { + regex: /^_private_/, + }, + }, }), ], }; diff --git a/tsconfig.base.json b/tsconfig.base.json index d52a67f65d..da1b9f1c40 100644 --- a/tsconfig.base.json +++ b/tsconfig.base.json @@ -19,6 +19,11 @@ "noImplicitReturns": true, "noUnusedLocals": true, "outDir": "lib", + "plugins": [ + { + "transform": "ts-transformer-minify-privates" + } + ], "preserveConstEnums": true, "resolveJsonModule": true, "rootDir": "./",