angular - 运行 ng e2e 时 dist/out-tsc-e2e 在哪里?

标签 angular typescript protractor

我正在运行 ng e2e

我希望在 dist/out-tsc-e2e 中看到编译后的 JavaScript;但是,我没有看到这个目录 (out-tsc-e2e)。

// tsconfig.json
{
  "compileOnSave": false,
  "compilerOptions": {
    "declaration": false,
    "emitDecoratorMetadata": true,
    "experimentalDecorators": true,
    "module": "commonjs",
    "moduleResolution": "node",
    "outDir": "../dist/out-tsc-e2e",
    "sourceMap": true,
    "target": "es5",
    "typeRoots": [
      "../node_modules/@types"
    ]
  }
}

我问这个问题的原因是我对运行 ng e2e 时发生的情况感到困惑。

那是编译e2e/中的 typescript 文件的时候吗?

最佳答案

这似乎是 angular-cli 构建项目的方式。我相信原因是如果您确实在此目录中运行 tsc,这些文件将被转换到 dist/目录。这很棒,因为转译的 JavaScript 文件不会被提交,因为 dist/是 .gitignore 的一部分。

当您运行 ng e2e 时,Protractor 测试不会转译 TypeScript,因为 onPrepare 方法使用 ts-node 来运行 TypeScript,而无需转换为 JavaScript。

关于angular - 运行 ng e2e 时 dist/out-tsc-e2e 在哪里?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42030537/

相关文章:

html - 禁止在图像 URLS 上使用 403

typescript - 如何 "import"TypeScript 定义文件中的命名空间

javascript - Protractor 中的 setTimeout 替代方案

jasmine - 如何查看当前正在执行哪些 Protractor 测试?

javascript - Protractor - ngFor 循环

angular - 如何在启动时将列表(http 调用)加载到 Angular 5 中的应用程序范围?

Angular 2 多槽嵌入

javascript - 类型 'this' 不可分配给类型 'T'

javascript - 无法将 remote.require() 与 TypeScript 一起使用

http - Angular2 http.get()、map()、subscribe() 和可观察模式——基本理解