-
Notifications
You must be signed in to change notification settings - Fork 1
Quick Start
npm install -g tsmc
You have two options available to cofigure your module: create a .tsm
file with your module configuration or
if you have a add a package.json
file you can simply add tsm
property to your json config.
Both ways have the same configuration options available. Check the api docs for the ModuleConfig class for more the details on the options, but here goes a quick summary.
name
and moduleRoot
{
"name": "MyCompanyUtils",
"src": ["**/*.ts", "!**/*.d.ts"],
"moduleRoot": ".",
"parentModule": "",
"submodules": {
"server": "server/server.tsm",
"ui": "ui",
"ajax": {
"src": ["**/*.ts", "!**/*.d.ts"],
"moduleRoot": "ajax",
"dependencies": {
"jack.ui": "../ui"
}
}
},
"dependencies": {},
"options": {
"allowbool": false,
"allowimportmodule": false,
"declaration": true,
"mapRoot": "",
"moduleKind": ModuleKind.None,
"noImplicitAny": false,
"noResolve": false,
"outDir": "",
"removeComments": false,
"sourcemap": true,
"sourceRoot": ""
}
}
The straigh to the point explanation is:
Submodules are modules that you want compiled individually and as part of a parent module. Think bootstrap.js
and modal.js
, they are the parent module and submodule.
Dependencies are modules that need to be referenced, but you don't want as part of the compile code.
Both are configured in the same way: a hash where each property is a module's or reference's name and the value is a reference to a module.
A reference can take onde of these three forms:
- a path to a file which contains the configuration of a module (either a
.tsm
or apackage.json
) - a path to a folder which contains a file (like above) with the module config
- a hash with the referenced module configuration following the same rules as any other config
Just call
$ tsm MODULE_PATH
Where MODULE_PATH
can be
- A path to a config file (either a
.tsm
or apackage.json
) - A folder which contains a config file