question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Vite doesn't seem to honor .gitignore and tries to parse unrelated html files

See original GitHub issue

Is your feature request related to a problem? Please describe. I have some .html files lying around in my project, which should be ignored by Vite. But when I try to run vite, I get the following error:

$ vite
error when starting dev server:
Error: The following dependencies are imported but could not be resolved:

  testlib123.es.js (imported by /home/fabd/Code/github/some-project/src/assets/__fab/__test.html)

Typically I like to exclude files with double underscore in my gitignore, but in this case I also have a .gitignore IN this folder where __test.html is :

# private files
*
.gitignore

So for all intents and purposes it seems vite does not ignore unrelated html files, even when they are not called index.html.

I also tried to place my test file outside of the src/ folder. For example from the project’s root folder ./__foo/__test.html, same error.

Describe the solution you’d like Vite should probably honor the .gitignore, so that I can keep unrelated html files in my project’s folder.

Describe alternatives you’ve considered

Additional context

Thanks!

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
patak-devcommented, Mar 20, 2021

@fabd @yaquawa this is already being tracked here https://github.com/vitejs/vite/issues/2599

0reactions
fabdcommented, Mar 20, 2021

It seems the code does look for any html files, not just index.html

https://github.com/vitejs/vite/blob/bc35fe994d48b2bd7076474f4a1a7b8ae5e8f401/packages/vite/src/node/optimizer/scan.ts#L60

I could use optimizeDeps.entries I suppose.

In order to make it easy for beginners, would it make sense to ignore any html files besides the first one found, in the default scenario when user does not explicitly set any entries options?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Replace master with feature/zuulv3 · 3f3b744263 - zuul
4) Read developer documentation on the internal data model and testing: http://docs.openstack.org/infra/zuul/feature/zuulv3/developer.html.
Read more >
Gitiles - GerritHub.io
Abdulhadi5692HDI/Abdulhadi5692HDIConfig files for my GitHub profile. ... HTML source code, samples, and documentation.
Read more >
Source Tree is EXTREMELY slow for any action - Jira - Atlassian
Sourcetree(1.6.12) is constantly not responding and takes 25%+ of my cpu until I end task on it, doesn't really matter what I'm doing...
Read more >
Openafs 1.9.0 ChangeLog
Instead of trying to predict the name of the resulting source RPM file from the OpenAFS ... However the code does not parse...
Read more >
Older Announcements - GnuCash
The following fixes and improvements were not associated with bug reports: · Accommodate Guile-3.0 in Scheme code. · [html-style-info] Display fractional amounts ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found