When importHelpers is set to true in tsconfig.json, rewriteLocalizeCalls() doesn't generate any bundle files so all localize() invocations go to fallback.
Did a little debug and found out that, the condition here
|
if (ts.isCallExpression(parent) && ts.isIdentifier(parent.expression) && parent.expression.text === '__importStar') { |
is not met.
Possible JS transpiled when using tslib import helpers:
const nls = tslib_1.__importStar(require("vscode-nls"));
Here the expression turns from a global function call to a member access. This case can be handled by (for example):
if (ts.isCallExpression(parent) && ((ts.isIdentifier(parent.expression) && parent.expression.text === '__importStar') || (ts.isPropertyAccessExpression(parent.expression) && parent.expression.name.text === "__importStar")))