Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/angular/27.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在编译typescript后添加前缀以导入URL_Typescript_Angular - Fatal编程技术网

在编译typescript后添加前缀以导入URL

在编译typescript后添加前缀以导入URL,typescript,angular,Typescript,Angular,我有一个angular2应用程序,我正在用打字脚本编写 我想知道是否有可能让typescript编译器为所有导入的URL添加前缀(和后缀) 例如,我得到了以下代码: import {AppComponent} from 'app.component'; 在javascript中编译成如下内容: System.register(['./test/app.component'], ... 但我想要的是: System.register(['<some_path>/test/app.c

我有一个angular2应用程序,我正在用打字脚本编写

我想知道是否有可能让typescript编译器为所有导入的URL添加前缀(和后缀)

例如,我得到了以下代码:

import {AppComponent} from 'app.component';
在javascript中编译成如下内容:

System.register(['./test/app.component'], ...
但我想要的是:

System.register(['<some_path>/test/app.component.js'], ...
System.register(['/test/app.component.js']。。。
其中“some_path”可以是例如“component/my_app/”