I'm using a library that requires binary and txt files in order to work. In its API, I need to call a set_path()
method with the path to said files. The issue is these files aren't included in the lib folder when building the project with npm, so the API is not working properly. Is there a way to include this folder of non JS files in my build folder without having to copy it manually?
Asked
Active
Viewed 482 times
1

Daniel Hernandez
- 164
- 2
- 13
-
1Most certainly there is, but without describing the "build system" you are using it is impossible to tell you how to proceed. – Randy Casburn Jan 01 '21 at 20:30
-
Running `npm build` in my project runs the tsc command, which transpiles my TypeScript to JavaScript. Right now I overrode the command to be `tsc && cp files/ lib/files/` to copy the files. – Daniel Hernandez Jan 01 '21 at 20:41
-
What's wrong with your solution? – Randy Casburn Jan 01 '21 at 20:44
-
I'm just not sure if this is the best way of solving this. – Daniel Hernandez Jan 01 '21 at 21:46
-
1It is a fine solution for now. But, you have discovered why there are so many "task runners" in the world of JavaScript. Whether it is grunt, gulp, or the full blown beast of Webpack, you will eventually need some automated build tool that expands beyond just the compiler. I encourage you to explore the ones I've mentioned. – Randy Casburn Jan 01 '21 at 21:51
-
Will do! Thanks :) – Daniel Hernandez Jan 01 '21 at 22:19