Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

App fails to compile when using rootDir in tsconfig #6

Open
humbertosales opened this issue Sep 25, 2017 · 1 comment
Open

App fails to compile when using rootDir in tsconfig #6

humbertosales opened this issue Sep 25, 2017 · 1 comment

Comments

@humbertosales
Copy link

I am using the library ng2-permission in my project. My project is a authentication library created for generator-angular2-library...

Unfortunately the ng2-permission was publish with .ts files...

The problem is that the NPM package contains *.ts files. This seems to be due to .ts and .d.ts files existing within the same directory and causing the typescript compiler to recompile the module and then getting confused because it is outside of the rootDir.

Can you publish one version without src?

ERROR:

Error File '/opt/projeto/node_modules/angular2-permission/index.ts' is not under 'rootDir' '/opt/projeto/.tmp'. 'rootDir' is expected to contain all source files.
Error File '/opt/projeto/node_modules/angular2-permission/src/directives/except-permission.directive.ts' is not under 'rootDir' '/opt/projeto/.tmp'. 'rootDir' is expected to contain all source files.
Error File '/opt/projeto/node_modules/angular2-permission/src/directives/has-permission.directive.ts' is not under 'rootDir' '/opt/projeto/.tmp'. 'rootDir' is expected to contain all source files.
Error File '/opt/projeto/node_modules/angular2-permission/src/index.ts' is not under 'rootDir' '/opt/projeto/.tmp'. 'rootDir' is expected to contain all source files.
Error File '/opt/projeto/node_modules/angular2-permission/src/model/permission-guard.model.ts' is not under 'rootDir' '/opt/projeto/.tmp'. 'rootDir' is expected to contain all source files.
Error File '/opt/projeto/node_modules/angular2-permission/src/module/ng2-permission.module.ts' is not under 'rootDir' '/opt/projeto/.tmp'. 'rootDir' is expected to contain all source files.
Error File '/opt/projeto/node_modules/angular2-permission/src/services/permission-helper.service.ts' is not under 'rootDir' '/opt/projeto/.tmp'. 'rootDir' is expected to contain all source files.
Error File '/opt/projeto/node_modules/angular2-permission/src/services/permission.guard.ts' is not under 'rootDir' '/opt/projeto/.tmp'. 'rootDir' is expected to contain all source files.
Error File '/opt/projeto/node_modules/angular2-permission/src/services/permission.service.ts' is not under 'rootDir' '/opt/projeto/.tmp'. 'rootDir' is expected to contain all source files.
[19:21:35] 'ngc' errored after 7.28 s
[19:21:35] Error: ngc compilation failed
    at ngc.then (/opt/projeto/gulpfile.js:59:15)

tsconfig:

{
  "compilerOptions": {
    "compileOnSave": false,
    "declaration": true,
    "module": "es2015",
    "target": "es5",
    "baseUrl": ".",
    "stripInternal": true,
    "emitDecoratorMetadata": true,
    "experimentalDecorators": true,
    "moduleResolution": "node",
    "rootDir": ".",
    "outDir": "../build",
    "lib": [
      "es2016",
      "dom"
    ],        
    "skipLibCheck": true,
    "types": []
  },
  "angularCompilerOptions": {
    "annotateForClosureCompiler": true,
    "strictMetadataEmit": true,
    "skipTemplateCodegen": true,
    "flatModuleOutFile": "my-login.js",
    "flatModuleId": "my-login"
  },
  "files": [
    "./index.ts"
  ]
}
@JavadRasouli
Copy link
Owner

you can concat *.js files in dist folder and use them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants