When I manually build .ts
files using the tsc
tool, I notice that wrappers are generated for async/await keywords.
However, I am facing an issue setting up transpile on-the-fly using SystemJS.
Here is my index.htm configuration:
<script src="https://cdnjs.cloudflare.com/ajax/libs/systemjs/0.19.16/system.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/typescript/1.7.5/typescript.min.js"></script>
<script>
System.config({
transpiler: 'typescript',
typescriptOptions: {
target: 'es6'
},
packages: {
'': {
defaultJSExtensions: 'ts'
}
}
});
System.import('app').catch(console.error.bind(console));
</script>
My app.ts file looks like this:
console.log('hello');
async function run() {
console.log('world');
}
run();
Error in Developer Console:
SyntaxError: missing ; before statement
You can view the code on Plunker.