0
다중 파일 node.js 프로젝트를 Typescript 내부 모듈을 사용하여 .js
단일 파일로 컴파일하는 여러 파일 Typescript 프로젝트로 이식하려고합니다. 어떻게 require
내부 Typescript 모듈에서 node.js 모듈을 할 수 있습니까?내부 타이프 스크립트 모듈에 node.js 모듈 필요
a.js :
var os = require('os')
exports.foo = os.hostname()
b.js :
이var os = require('os')
exports.foo = os.hostname()
어떻게 포트 코드가 타이프하는 않습니다 다음은 샘플 응용 프로그램입니다?
a.ts :
/// <reference path="b.ts" />
console.log(b.foo)
b.ts :
module b {
export var foo = 42;
}
어떻게 foo = os.hostname()
작품 때문에 코드를 변경합니까 내가 필요로 할 때까지
신고 : https://typescript.codeplex.com/workitem/2407 – basarat
문제가 해결되었습니다. 내부 모듈이 포함되도록 예제를 재 설계해야합니다. – nponeccop
기능 요청이 중복되어 (https://typescript.codeplex.com/workitem/759) 근본적으로 현재 지원되지 않는다고 말합니다. – basarat