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

yalc publish removes nested node_modules #243

Open
cristian-eriomenco opened this issue May 22, 2024 · 2 comments
Open

yalc publish removes nested node_modules #243

cristian-eriomenco opened this issue May 22, 2024 · 2 comments

Comments

@cristian-eriomenco
Copy link

cristian-eriomenco commented May 22, 2024

Suppose you have a folder structure for your bundle as follows:

dist/components/index.js
dist/utils/index.js
dist/node_modules/somepackageA/index.js
dist/node_modules/somepackageB/dist/node_modules/sompackageC/index.js
dist/node_modules/somepackageB/index.js

Everything containing node_modules would end-up being removed once issuing yalc publish

One might ask why do you have node_modules ? Well for instance i use rollup with preserveModules: true

  output: [
    {
      dir: 'dist/esm',
      format: 'esm',
      preserveModules: true,
      preserveModulesRoot: 'src',
      sourcemap: true,
    },
    {
      dir: 'dist/cjs',
      format: 'cjs',
      preserveModules: true,
      preserveModulesRoot: 'src',
      sourcemap: true,
    },
  ],

Which would mimic the folder structure, but not only this. There are also deeply nested dependencies which also have node_modules eg: cache-manager which makes publishing impossible

@michaelangeloio
Copy link

@cristian-eriomenco yup, this is happening for us too.

Is there a way to override this?

@michaelangeloio
Copy link

@cristian-eriomenco yup, this is happening for us too.

Is there a way to override this?

const ignore = '**/node_modules/**'

looks like it's not possible to override, it's literally hardcoded...

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