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

Feature Request: Support for pnpm in Dockerfile Generation Based on packageManager Setting in nx.json #1087

Open
liam-daley opened this issue Jul 16, 2024 · 0 comments

Comments

@liam-daley
Copy link

Description:

Currently, the @nx-tools/nx-container plugin generates Dockerfiles with npm commands for package installations, regardless of the package manager set in the nx.json file. To enhance compatibility and streamline development workflows, it would be beneficial for the plugin to dynamically adjust the Dockerfile to use pnpm commands when the packageManager setting in nx.json is set to 'pnpm'.

Proposed Feature:

  1. Detect packageManager Setting:

    • Modify the Dockerfile generation logic to read the packageManager setting from nx.json.
  2. Conditional Command Generation:

    • If packageManager is set to 'pnpm', use pnpm commands for installing packages in the generated Dockerfile.
    • Otherwise, default to npm commands.

Example Implementation:

  • Current command with npm:

    RUN npm install --omit=dev
  • Desired command with pnpm:

    RUN pnpm install --prod

Thank you for considering this feature request. I believe it will significantly benefit the Nx community by providing better integration with pnpm.

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

1 participant