Missing *.ts files (due to `npm link` ?)

后端 未结 4 2306
梦毁少年i
梦毁少年i 2020-12-31 08:22

I have this import statement in an Angular5 project:

import {plugins, SCECodeGenType} from \'sce-plugins/code-generation\';

this resolves t

4条回答
  •  庸人自扰
    2020-12-31 08:46

    So after reading this Github issue again: https://github.com/angular/angular-cli/issues/8284

    I made this change in .angular-cli.json:

      "defaults": {
        "build": {
          "preserveSymlinks": true //   <<<< add this
        },
        "styleExt": "scss",
        "component": {
        }
      }
    

    and now, given that preserveSymlinks flag and the include field in my tsconfig.app.json file:

     "include":[
        "./**/*.ts",
        "../node_modules/sce-plugins/**/*.ts"
      ],
    

    I can now symlink 'sce-plugins' into my main project, instead of manually copying the files. It's possible that you won't need the "include" field at all, although I found that if I removed the "include" field, that it wouldn't work.

提交回复
热议问题