示例工程 19-namespaces-ts-modules
19-namespaces-ts-modules/03-outfile-removed/README.md
点击「运行示例」后,左侧显示源码、右侧显示运行结果;console 输出会实时回传。
# 03 · outfile-removed
**演示**:`outFile`、`baseUrl`、`module Foo {}` 三种历史写法在 TS 7 下的真实报错。
**运行**:无运行时输出;Console 为空。
**类型检查**:`node node_modules/typescript/bin/tsc -p examples/19-namespaces-ts-modules/03-outfile-removed/tsconfig.types.json`
**预期类型错误**:
```text
tsconfig.fail-outfile.json(6,5): error TS5102: Option 'outFile' has been removed. Please remove it from your configuration.
tsconfig.fail-baseurl.json(4,5): error TS5102: Option 'baseUrl' has been removed. Please remove it from your configuration.
Use '"paths": {"*": ["./src/*"]}' instead.
demo/legacy-module.ts(3,8): error TS1540: A 'namespace' declaration should not be declared using the 'module' keyword. Please use the 'namespace' keyword instead.
```
**注意**:`outFile` 的「单文件合并」语义今天靠打包器或手写拼接脚本实现,`tsc` 不再负责。