Skip to content

Fix CLI template gitignore scaffolding#11380

Open
cameronapak wants to merge 1 commit into
remix-run:mainfrom
cameronapak:fix-cli-template-gitignore
Open

Fix CLI template gitignore scaffolding#11380
cameronapak wants to merge 1 commit into
remix-run:mainfrom
cameronapak:fix-cli-template-gitignore

Conversation

@cameronapak
Copy link
Copy Markdown

@cameronapak cameronapak commented May 9, 2026

Fixes #11342

This fix makes it where .gitignore is properly added to the scaffolded project when running npx remix@next new.

Why does the .gitignore file not get added when scaffolding a Remix 3 project? NPM packlist says, "If you have a package.json file with a files array within, any top level .npmignore and .gitignore files will be ignored."

  • Renames the root app template ignore file to template/gitignore so it survives npm packaging.
  • Maps gitignore to .gitignore in the scaffold copy step.
  • Extends the scaffold test to assert generated apps include .gitignore and do not leak a plain gitignore file.

This mirrors the established scaffolding convention used by Create React App templates: the template contains gitignore, and the create command renames it to .gitignore during project creation. npm's own packlist rules call out .gitignore and .npmignore as package-control files that are commonly omitted from package tarballs, and npm's package docs note that ignore files still affect package contents under included directories.

References:

@cameronapak cameronapak force-pushed the fix-cli-template-gitignore branch from c347437 to d699ed0 Compare May 9, 2026 18:29
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

Successfully merging this pull request may close these issues.

installation missing .gitignore

1 participant