Open unlight opened 5 years ago
Install instruction to setup TypeScript Custom Code Transformer https://github.com/rimeto/ts-optchain#typescript-custom-code-transformer
TTypescript
/***/ "./node_modules/ts-optchain/dist/proxy/index.js": /*!******************************************************!*\ !*** ./node_modules/ts-optchain/dist/proxy/index.js ***! \******************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) {
"use strict";
/**
I do not see transformed result, e.g.
const value = (obj != null && obj.propA != null && obj.propA.propB != null && obj.propA.propB.propC != null) ? obj.propA.propB.propC : defaultValue;
getCustomTransformers
ts-loader
getCustomTransformers: program => ({ before: [ require('ts-optchain/transform').default(program), ] }),
Environment
node 12.6 +-- ts-loader@6.0.2 +-- ts-optchain@0.1.7 +-- ttypescript@1.5.7 `-- typescript@3.5.2
Same problem!
Anyone managed to solve this?
This is not an issue for me, since typescript 3.7 with optional chaining feature.
Install instruction to setup TypeScript Custom Code Transformer https://github.com/rimeto/ts-optchain#typescript-custom-code-transformer
TTypescript
Bundle contains"use strict";
/**
const value = (obj != null && obj.propA != null && obj.propA.propB != null && obj.propA.propB.propC != null) ? obj.propA.propB.propC : defaultValue;
getCustomTransformers
ofts-loader
Part of webpack.configEnvironment