Open HolgerJeromin opened 4 years ago
Per the docs, outFile
is only legal when module
is AMD
or System
, but the lack of error message seems like a bug.
Wow.
We are using outFile
with module=none
for over five years without problems.
I always interpreted the docs as
The only module loader that can be used in conjunction with --outFile are "AMD" and "System".
and not as
Only the values "AMD" and "System" can be used in conjunction with --outFile. Even "None" is not allowed.
Waiting for feedback from product owner.
The new website explains it: https://www.typescriptlang.org/tsconfig#outFile
Note: outFile cannot be used unless module is None, System, or AMD. This option cannot be used to bundle CommonJS or ES6 modules.
So our code is valid :-)
This one does not compile either with NO error message:
export interface myInterface{
value: boolean;
}
function a(){}
Works without problems when removing export
.
Even easier to reproduce:
/* Fixing self https://github.com/microsoft/TypeScript/issues/11781 */
declare var self: ServiceWorkerGlobalScope; // eslint-disable-line @typescript-eslint/no-redeclare
export { };
with
"compilerOptions": {
"lib": [
"WebWorker",
"scripthost",
"ESNext"
],
"outFile": "ServiceWorker.js"
TypeScript Version: 3.8.3
Search Terms:
Code
Expected behavior: This should compile without problems. Actual behavior: When I configure an
outfile
no file is generated (js
and no.d.ts
,.js.map
). But we get no error message about this! This is the same with--verbose
:Test 1: Removing the
outfile
generates the following block inmain.js
:Test 2: Removing
export
inmain.ts
we get innewFile.js
:Thats why I think merging
Object.defineProperty(exports, "__esModule", { value: true });
into oneoutfile
causes the abort.Playground Link: Not possible, as we need
outfile
to trigger the bug.Related Issues: none found