简体   繁体   中英

Typescript, AMD and module names

Is there a way to set the names of the compiled modules from *.ts? Some tsconfig,json setting, or some Gulp pluggin that could do this.

Currently I'm getting

define([], function(){ .. })

But i wan't to be able to set the name like so:

define('module-name', [], function(){ .. })

Tried a few gulp pluggins but they overwrite the sourcemaps information and i loose the "ts debugging" ability in the browser

You can use a declaration at the top of your module to get the desired result:

///<amd-module name='foo-module'/>

This will result in

define('foo-module', [], function(){ .. })

being emitted by the compiler

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM