10000 @nx/esbuild:esbuild asset copy ignores input files if they are ignored by the root .gitignore file · Issue #26602 · nrwl/nx · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

@nx/esbuild:esbuild asset copy ignores input files if they are ignored by the root .gitignore file #26602

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

Open
1 of 4 tasks
heathprovost opened this issue Jun 19, 2024 · 6 comments

Comments

@heathprovost
Copy link

Current Behavior

Currently if the value of the input property on an item in the assets option is in a location ignored by git it will not be copied. This makes no logical sense, because most of the things you would choose to copy in an assets copy step are the output of transforms that you would almost always choose to ignore in your repo.

Expected Behavior

The contents of .gitignore should not influence the behavior of asset copies at all.

GitHub Repo

No response

Steps to Reproduce

I did not create a repo, but the offending code can be clearly seen here:

https://github.com/nrwl/nx/blob/master/packages/js/src/utils/assets/copy-assets-handler.ts#L69

Nx Report

NX   Report complete - copy this into the issue template

Node   : 20.12.2
OS     : linux-x64
npm    : 10.5.0

nx                 : 18.1.2
@nx/js             : 18.1.2
@nx/jest           : 18.1.2
@nx/linter         : 18.1.2
@nx/eslint         : 18.1.2
@nx/workspace      : 18.1.2
@nx/cypress        : 18.1.2
@nx/devkit         : 18.1.2
@nx/esbuild        : 18.1.2
@nx/eslint-plugin  : 18.1.2
@nx/next           : 18.1.2
@nx/node           : 18.1.2
@nx/plugin         : 18.3.5
@nx/react          : 18.1.2
@nx/rollup         : 18.1.2
@nx/storybook      : 18.1.2
@nrwl/tao          : 18.1.2
@nx/web            : 18.1.2
@nx/webpack        : 18.1.2
nx-cloud           : 18.0.0
typescript         : 5.3.3
---------------------------------------
Community plugins:
@nx-dotnet/core        : 2.2.0
@nx-tools/nx-container : 5.2.0
nx-stylelint           : 17.0.1
---------------------------------------
Local workspace plugins:
         @stuller/nx
---------------------------------------
The following packages should match the installed version of nx
  - @nx/plugin@18.3.5
  - @nrwl/nx-plugin@18.3.5

To fix this, run `nx migrate nx@18.3.5`

Failure Logs

No response

Package Manager Version

No response

Operating System

  • macOS
  • Linux
  • Windows
  • Other (Please specify)

Additional Information

No response

@heathprovost heathprovost changed the title @nx/esbuild:esbuild asset copy ignores input files if they are in the root .gitignore @nx/esbuild:esbuild asset copy ignores input files if they are ignored by the root .gitignore file Jun 19, 2024
@wvq
Copy link
wvq commented Sep 12, 2024

any updates? Some local file need to copy to dist folder for developing, but shouldn't commit to git. behaves like .env.local.

@lppedd
Copy link
lppedd commented Sep 12, 2024

I've patched @nx/js via patch-package. Will post the patch file in the morning.

@lppedd
Copy link
lppedd commented Sep 13, 2024

See #20309 (comment)

@shlomisas
Copy link

i also have this problem which is quite similar, i'm using npm config which also have order of files loading and when im overriding stuff with local.json5 file it doesn't work as somehow assets not copy .gitignore files without any reasonable excuse!

@arimgibson
Copy link

I understand why this was done but it should be documented somewhere, and also be overwriteable via ! in the ignore block:

            {
              "glob": "**/*.js",
              "input": "libs/x/src/generated",
              "output": "libs/x/src/generated",
              "ignore": [
                "!libs/x/src/generated"
              ]
            }

@arimgibson
Copy link

Edit: you can overwrite by setting ! in the .nxignore file. It reads .gitignore first, then can overwrite with .nxignore. Still think this should be kept open because it's frustrating to have to dig through source code to learn that

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants
0