@nx:js executors don't allow copying assets from gitignored folders #23293
Replies: 4 comments 1 reply
-
no fix on this? |
Beta Was this translation helpful? Give feedback.
-
Hey there. Really annoying. Imagine you have monorepo with multiple prisma libs (each with its own schema and client). Now, when you build an app that uses one of these libs, you want to copy the For now, we have to install the prisma and generate the client inside of the container (in Dockerfile), which adds extra 30-40 seconds to every build in the CI. |
Beta Was this translation helpful? Give feedback.
-
hi, same problem here with multiple apps sharing the same static assets to be copied over each app's |
Beta Was this translation helpful? Give feedback.
-
Also same problem if you want to copy assets from a node_modules installed package, since you will have node_modules in your gitignore file |
Beta Was this translation helpful? Give feedback.
-
Current Behavior
The @nx:js executors have an option to copy assets over to the build artifacts of the current project being built. However, this automatically ignores any files that match a pattern in the .gitignore / .nxignore files. Because of this, it is impossible to have a lib contribute assets to another lib / app if this assset is a build artifact.
In our setup we have a lib that produces a CSS file based on some SCSS input files. The CSS file is a build artifact.
We would like to consume this CSS file as an asset in another lib, using the assets of the @nx:js executor.
The culprits are the following lines:
https://github.com/nrwl/nx/blob/master/packages/js/src/utils/assets/copy-assets-handler.ts#L68
https://github.com/nrwl/nx/blob/master/packages/js/src/utils/assets/copy-assets-handler.ts#L185
Expected Behavior
I would expect this behaviour to be configurable. For example, an option could be added to the asset object to instruct NX to not ignore .gitignored files.
GitHub Repo
No response
Steps to Reproduce
Nx Report
Failure Logs
No response
Package Manager Version
No response
Operating System
Additional Information
No response
Beta Was this translation helpful? Give feedback.
All reactions