使用引用将typescript文件加载到另一个typescript文件中
我是打字新手。我想使用使用引用将typescript文件加载到另一个typescript文件中,typescript,typescript-typings,Typescript,Typescript Typings,我是打字新手。我想使用标记将一个Typescript文件加载到另一个Typescript文件中 我做了点什么,但没用!请帮帮我 first.ts: import * as $ from './JQuery'; alert("Message 2: I want to run!"); $("#myParagraph").click(function () { alert("hello!"); }); /// <reference path="./first.ts"/> al
标记将一个Typescript文件加载到另一个Typescript文件中
我做了点什么,但没用!请帮帮我
first.ts:
import * as $ from './JQuery';
alert("Message 2: I want to run!");
$("#myParagraph").click(function () {
alert("hello!");
});
/// <reference path="./first.ts"/>
alert("Message 1: app.ts loaded!");
{
"compilerOptions": {
"noImplicitAny": false,
"noEmitOnError": true,
"removeComments": false,
"sourceMap": true,
"target": "es5",
"outDir": "../wwwroot/scripts",
"module": "umd"
}
}
app.ts:
import * as $ from './JQuery';
alert("Message 2: I want to run!");
$("#myParagraph").click(function () {
alert("hello!");
});
/// <reference path="./first.ts"/>
alert("Message 1: app.ts loaded!");
{
"compilerOptions": {
"noImplicitAny": false,
"noEmitOnError": true,
"removeComments": false,
"sourceMap": true,
"target": "es5",
"outDir": "../wwwroot/scripts",
"module": "umd"
}
}
使用类型脚本编译器的--outFile
参数将所有内容连接到一个文件中。浏览器不会分析
标记
像这样:
tsc——导出我的大javascript.js