Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/378.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
Javascript 重写编译器主机_Javascript_Html_Node.js_Angular_Typescript - Fatal编程技术网

Javascript 重写编译器主机

Javascript 重写编译器主机,javascript,html,node.js,angular,typescript,Javascript,Html,Node.js,Angular,Typescript,我有一个非常特殊的用例,我需要一些自定义的编译器行为 基本上,当我在TS文件中有一个导入时,比如 import {TableComponent} from '../components/table-component.ts'; 我想更改路径,以便最终使用另一个文件 import {TableComponent} from '../../otherSource/components/table-component.ts'; 我知道我需要做什么,但我不知道如何重写Angular/TS的编译器主机

我有一个非常特殊的用例,我需要一些自定义的编译器行为

基本上,当我在TS文件中有一个导入时,比如

import {TableComponent} from '../components/table-component.ts';
我想更改路径,以便最终使用另一个文件

import {TableComponent} from '../../otherSource/components/table-component.ts';

我知道我需要做什么,但我不知道如何重写Angular/TS的编译器主机。我需要某种方法来重写方法,编译器在哪里加载文件。

您尝试过路径映射吗?是的,但似乎不支持相对路径。