scalacenter / scalajs-bundler

https://scalacenter.github.io/scalajs-bundler
Other
237 stars 101 forks source link

[0.15.0] Directory within a `jsSourceDirectories` gives error #296

Closed PuneetPatwari closed 5 years ago

PuneetPatwari commented 5 years ago

Using 0.15.0-0.6, I am trying to make use of the key jsSourceDirectories. I have the following hierarchy of some resource files

resources
|____types
        |____index.d.ts

If I set the jsSourceDirectories to point to the root resources directory I get the following exception Source file 'resources/types' is a directory. However, the functionality should have been recursive and resolve all the files or the sub-directories can be copied as is. Is this a bug?

julienrf commented 5 years ago

Thanks for the detailed report. Indeed, the sub-directories should be copied. I think the limitation you’re hitting lies in this line:

https://github.com/scalacenter/scalajs-bundler/blob/72f7b9ac8e79ed3a1d2b7da490bf618a98a4881c/sbt-scalajs-bundler/src/main/scala/scalajsbundler/sbtplugin/NpmUpdateTasks.scala#L80

The allSubpaths method includes directories in its result, the solution would be to filter them out.

Would you be interested in contributing a fix for this? (or maybe @ant8e?)

PuneetPatwari commented 5 years ago

Hi. Yes I figured the same source as the problem. I will try to do something by tomorrow.