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

Should default to index.html, or show an error #1797

Closed
raould opened this issue Jul 26, 2018 · 8 comments · Fixed by #1848
Closed

Should default to index.html, or show an error #1797

raould opened this issue Jul 26, 2018 · 8 comments · Fixed by #1848

Comments

@raould
Copy link

raould commented Jul 26, 2018

🙋 feature request

🤔 Expected Behavior

parcel should default to using index.html, or error out.

😯 Current Behavior

  1. I have a project with index.html
  2. I type "parcel" not "parcel index.html"
  3. parcel starts up happily
  4. but when i load the site, i get nothing.

Expected

  1. I have a project with index.html
  2. I type "parcel" not "parcel index.html"

either

  • parcel starts up happily by using index.html by default.
    or
  • parcel throws an error.
@DeMoorJasper
Copy link
Member

Parcel currently looks at the main in pkg.json if using parcel.

We could however do a glob for index and use the first one it finds. Downside of this is it's pretty unpredictable. If you'd add a CSS file named index in the same folder it would bundle that instead of HTML

@raould
Copy link
Author

raould commented Jul 28, 2018

I suggest just erroring if there's no explicit "instructions" either on the command line or through pkg.json (which i have never had). The situation where I do have index.html but I just run "parcel" with no arguments, and it /looks/ like it has started up, but kinda is not doing what I want, it sorta too confusing of a ux in my mind.

@DeMoorJasper
Copy link
Member

An error message seems like a good idea

@rajikaimal
Copy link

Hi, I can look into this

@DeMoorJasper
Copy link
Member

@rajikaimal great, let us know if you need any guidance or help :)

@rajikaimal
Copy link

Can you mention where the logic related to finding the main script in pkg.json resides?

@rajikaimal
Copy link

Hope this creates the intended behavior :)

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

Successfully merging a pull request may close this issue.

3 participants