Мне очень трудно пытаться импортировать модуль A:
export module A {
export class A_Class {
}
}
в мой модуль B:
import { A } from "./a";
let a = new A.A_Class();
Мой tsconfig.json
выглядит так:
{
"compilerOptions": {
"target": "esnext",
"module": "esnext",
"noImplicitAny": true,
"removeComments": true,
"preserveConstEnums": true,
"sourceMap": true
},
"compileOnSave": true,
"files": [
"a.ts",
"b.ts",
]
}
Мой cshtml
имеет этот раздел сценария:
<script type="module" src="~/Scripts/app/b.js"></script>
И браузер Chrome выдает ошибку:
http://localhost:64518/Scripts/app/a net::ERR_ABORTED 404 (Not Found)
Для line 1
вкл. b.js
:
import { A } from "./a";
У меня совершенно нет идей, и я пробовал много комбинаций es6
, commonjs
и т. Д., С ошибками import
, немного отличающимися.
Я использую Typescript 3.0
.