tsproject
tsproject copied to clipboard
NOTICE: When bundling always wrap a collection of exported functions in an external namespace declaration
Since TsProject bundles ES6 external modules into a single javascript library, you cannot have a "loose" collection of functions( classes, variables, etc ) within a source file. Wrap the functions in an external module definition. For example:
instead of:
export foo() {}
export bar() {}
use:
export namespace foobar {
export foo() {}
export bar() {}
}
This should be added to the wiki documentation.