Skip to content

Instantly share code, notes, and snippets.

@blink1073
Created November 6, 2017 17:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save blink1073/590367109779d537d781f9d739002836 to your computer and use it in GitHub Desktop.
Save blink1073/590367109779d537d781f9d739002836 to your computer and use it in GitHub Desktop.
es6 module with es5 target
import * as path from 'path';
function foo() {
return import('leaflet').then(function (mod) {
console.log(mod);
});
}
;
console.log(path);
console.log(foo);
import * as path from 'path';
function foo(): Promise<void> {
return import('leaflet').then(mod => {
console.log(mod);
});
};
console.log(path);
console.log(foo);
{
"compilerOptions": {
"declaration": true,
"noImplicitAny": true,
"noEmitOnError": true,
"noUnusedLocals": true,
"module": "esnext",
"moduleResolution": "node",
"target": "es5",
"outDir": "./lib",
"lib": ["ES5", "ES2015.Promise", "DOM", "ES2015.Collection"]
},
"include": ["src/*"]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment