-
Notifications
You must be signed in to change notification settings - Fork 69
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Helpers missing from output file for a TS script (instead of module) #48
Comments
Looks like you are hitting this one: microsoft/TypeScript#12167 -- TS treats this as global script, not a module, so it doesn't generate When I add any import or export to The plugin forces |
Did a quick test — seems like setting |
If TS emits helpers in each Could you post the test? Did you use 2 separate modules? Last time I checked it did that anyway, I'll try again later. |
I modified To test with
main.ts: import f from './module';
async function main() {
await f();
}
main(); module.ts: async function f() {
}
export default f; main.js: import * as tslib_1 from "tslib";
import f from './module';
function main() {
return tslib_1.__awaiter(this, void 0, void 0, function () {
return tslib_1.__generator(this, function (_a) {
switch (_a.label) {
case 0: return [4 /*yield*/, f()];
case 1:
_a.sent();
return [2 /*return*/];
}
});
});
}
main(); module.js import * as tslib_1 from "tslib";
function f() {
return tslib_1.__awaiter(this, void 0, void 0, function () {
return tslib_1.__generator(this, function (_a) {
return [2 /*return*/];
});
});
}
export default f; |
Thanks, I'll test on a few versions of typescript and remove |
This is in 0.10.0 |
I get a
Uncaught ReferenceError: __awaiter is not defined
when compiling a file with async. I'm using the latest TypeScript (2.6.2), rollup (0.53.0) and plugin (0.9.0).main.ts
rollup.config.js
tsconfig.json
main.js:
The text was updated successfully, but these errors were encountered: