You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Is it possible to specify the AMD module (project) name during compilation? #4027
Instead of generating anonymous AMD modules and declaration files, I'd like to be able to specify a root path name and have the output explicitly define the module names, so that the files can be easily concatenated and minified:
The current way is to use amd-module tag (more info].
Filling in the names should be simple assuming you have a --rootDir specifided. the question is how you would tell the compiler to do that? new flag? or always do it if you have rootDir?
I think a new flag would be reasonable. It would be nice not to have to use an amd-module tag in each module when the names just reflect the input hierarchy. Maybe something like --amdRoot which is used as the root of all module names, with the balance of the name computed from the input directory structure.
is this for both JS and .d.ts? how about enabling --out with --module to generate a single file for all modules with multiple define calls? would that solve the problem?
That would be fantastic. The ultimate goal is to concat the entire library (both JS and d.ts) into a single file(s) which can be distributed and easily consumed by external users via:
import { Foo } from 'myproject/core/foo';
import { Baz } from 'myproject/ui/baz';
Having the compiler generate the module names would at least make it possible to concat with external tools, but having it handle the total sequence would be awesome!
Activity
tinganho commentedon Jul 26, 2015
In addition to setting baseurl, I also think something like requirejs route mapping would also be appropriate for TS.
mhegazy commentedon Jul 26, 2015
The current way is to use
amd-moduletag (more info].Filling in the names should be simple assuming you have a
--rootDirspecifided. the question is how you would tell the compiler to do that? new flag? or always do it if you haverootDir?sccolbert commentedon Jul 26, 2015
I think a new flag would be reasonable. It would be nice not to have to use an
amd-moduletag in each module when the names just reflect the input hierarchy. Maybe something like--amdRootwhich is used as the root of all module names, with the balance of the name computed from the input directory structure.mhegazy commentedon Jul 26, 2015
is this for both JS and .d.ts? how about enabling
--outwith--moduleto generate a single file for all modules with multipledefinecalls? would that solve the problem?sccolbert commentedon Jul 26, 2015
That would be fantastic. The ultimate goal is to concat the entire library (both JS and d.ts) into a single file(s) which can be distributed and easily consumed by external users via:
Having the compiler generate the module names would at least make it possible to concat with external tools, but having it handle the total sequence would be awesome!
mhegazy commentedon Feb 22, 2016
this should be fixed then by #5090