Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

like image 599
zdrsh Avatar asked Jan 05 '23 22:01

zdrsh


1 Answers

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

like image 52
Ben Avatar answered Jan 13 '23 08:01

Ben