Подтвердить что ты не робот

Поддерживаются только модули "amd" и "system" - вне

При построении typescript в VSCode возникает следующая ошибка:

ошибка TS6082: поддерживаются только модули "amd" и "system" --out.

Мои настройки следующие:

tsconfig.json

{
    "compilerOptions": {
        "target": "ES5",
        "module": "commonjs",
        "out": "current/game.js",
        "removeComments": true,
        "sourceMap": false
    }
}

.vscode/tasks.json:

{
    "version": "0.1.0",

    // The command is tsc. Assumes that tsc has been installed using npm install -g typescript
    "command": "tsc",

    // The command is a shell script
    "isShellCommand": true,

    // Show the output window only if unrecognized errors occur.
    "showOutput": "silent",

    // args is the HelloWorld program to compile.
    "args": [],

    // use the standard tsc problem matcher to find compile problems
    // in the output.
    "problemMatcher": "$tsc"
}

Несмотря на ошибку, файл game.js создается и работает правильно.

У кого-нибудь есть мысли о том, что может вызвать эту ошибку?

4b9b3361

Ответ 1

Это означает, что он говорит. Вы не можете использовать --out/--outFile для объединения модулей вместе для Node.js/CommonJS, поскольку для CommonJS не существует формата пакета. Просто не используйте эту опцию для CommonJS, и соответствующие файлы JS будут выбрасываться для каждого входного файла модуля TS.