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

WIP: Don't serve on non html main assets #1088

Conversation

nicolaisueper
Copy link
Contributor

@nicolaisueper nicolaisueper commented Mar 28, 2018

This PR will fix #1005.

I currently do a strict check, whether the main entry asset has the .html file extension or not.
I don't know if anyone still does this today, but this would fail on .htm or .html5 main files.
This could be solved using a RegExp, like e.g. /htm|html|html5/.

But is it intended to support .hbs or other template language files as main assets?

I'd be happy if anyone has a suggestion / tip for this problem.

Regards
Nico

@DeMoorJasper
Copy link
Member

What about checking for asset type and only serving if asset type is html?

@nicolaisueper
Copy link
Contributor Author

Is there already a way to do this? I found nothing similiar.

@DeMoorJasper
Copy link
Member

DeMoorJasper commented Mar 28, 2018

There is not and i'm not really sure how you'd do it, but this approach would break any non-html file as entrypoint that gets converted into html like pug for example.
Assets don't really exist until bundling starts.

@matthewmueller
Copy link

matthewmueller commented Mar 29, 2018

Personally, I'd like to see an HTML page generated and served for non-HTML assets rather than failing to serve. Something like the way that https://github.com/jantimon/html-webpack-plugin works.

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.

[RFC] Don't start dev server for non-html entry points?
3 participants