Open basarat opened 9 years ago
id like to take this issue if it has not been worked on yet?
@jgw96 thanks for the attention. I've just updated this issue with comments about my opinions :rose:
The main concern is that I need to think about where this should actually go. I actually feel that getting started should receive a bit more love and I should teach tsc -w
first with a single file then follow it up with talking about modules and split for first NodeJs and then Webpack.
Its a more massive rewrite that I'll do when I have some spare time so leave it for now :rose:
Import
import * as $ from "jquery"
import {extend} from "jquery"
import {extend as ex} from "jquery"
// Useful if the name conflicts with a local variableimport something from "es6module";
// For default import. Not recommended https://basarat.gitbooks.io/typescript/content/docs/tips/defaultIsBad.htmlExport
export something
export default something
// Not recommended https://basarat.gitbooks.io/typescript/content/docs/tips/defaultIsBad.htmlexport = something;
// Not recommended for new code. Prefer default export or export individual itemsexport {extend as ex}
// Useful when you want to extend an aliasReexport
export * from 'mod';
// Great for top level file where you just export everthing from some sub module.export {v} from 'mod';
// Great for top level file e.g. main.js where you just export stuff from different files in your project.export {v as x} from 'mod';
// When you want to export stuff from someone else's module but with a different name.