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

Remove *.ts files from src during publishing to npm. #4

Closed
majo44 opened this issue Oct 28, 2015 · 2 comments
Closed

Remove *.ts files from src during publishing to npm. #4

majo44 opened this issue Oct 28, 2015 · 2 comments

Comments

@majo44
Copy link

majo44 commented Oct 28, 2015

During compilation I have the errors

error TS6059: File '../node_modules/ng2-translate/src/translate.parser.ts' is not under 'rootDir' '../src'. 'rootDir' is expected to contain all sou
rce files.
error TS6059: File '../node_modules/ng2-translate/src/translate.pipe.ts' is not under 'rootDir' '../src'. 'rootDir' is expected to contain all sourc
e files.
error TS6059: File '../node_modules/ng2-translate/src/translate.service.ts' is not under 'rootDir' '../src'. 'rootDir' is expected to contain all so
urce files.

Configuration:

// tsconfig.json
{
  "compilerOptions": {
    "target": "es5",
    "module": "system",
    "noImplicitAny": true,
    "declaration": true,
    "experimentalDecorators": true,
    "moduleResolution": "node",
    "noEmitHelpers" : true,
    "rootDir" : "src",
    "outDir" : "tmp/es5"
  },

  "exclude": [
    ".git",
    "node_modules",
    "tmp"
  ]
}

This is because ng2-translate.d.ts is importing from folder src where there are .d.ts and .ts files, and ts files are loading by default by tsc.

angular2 have a different approach where ts sources are in ts folder.

After removing .ts files from src everything works fine.

@ocombe
Copy link
Collaborator

ocombe commented Oct 28, 2015

Good point, thank you, I will change that for the next release!

@ocombe ocombe closed this as completed in 0581a5b Oct 29, 2015
@ocombe
Copy link
Collaborator

ocombe commented Oct 29, 2015

This is fixed in 0.1.5, let me know if that works for you

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