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

Way to copy .js files without allowJs flag #25

Open
npdev453 opened this issue Nov 12, 2021 · 4 comments
Open

Way to copy .js files without allowJs flag #25

npdev453 opened this issue Nov 12, 2021 · 4 comments

Comments

@npdev453
Copy link

npdev453 commented Nov 12, 2021

Hi everyone, I'm looking for a way to copy .js files in project without allowJs using this library.

Because in composition mode with references and with allowJs options, tsc trying to generate declarations for all .js files (or they should have own .d.ts) and it's a problem for a huge project.

app/module.js:6:1 - error TS9005: Declaration emit for this file requires using private name '(Anonymous function)'. An explicit type annotation may unblock declaration emit.

I see that all .js files skipped there, but maybe we can make it more responsive and allow copying .js by special flag also?

@swimauger
Copy link
Owner

Hi @npdev453,

I'm a little confused... Are you saying the allowJs option doesn't work with the other options you are using?

@npdev453
Copy link
Author

Yes, and I can't enable this flag, because it uses not for only copying .jss files.
But I still need to copy .js files into outDir and don't want to use any cmd or bash commands.

@swimauger
Copy link
Owner

Why not use allowJs with the exclude property? But also, allowJs shouldn't be copying over anything, but .js or .jsx files
Re: https://www.typescriptlang.org/tsconfig#include

@npdev453
Copy link
Author

Heh, yes, allowJs: true do not copy other files, but it does some another things ⚠️ not only copying.

https://www.typescriptlang.org/tsconfig#allowJs

.jss files going to be a part of project and trying to be proceeded with compiler (especially to generate declarations when declaration: true)

When I set allowJs and 'exclude: [*.js]', then nobody going to copy .js at all.

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