Closed bmbarker90 closed 8 years ago
@sldavidson @jpumford
Yep it does
@bmbarker90 Just want to make sure I get the idea - HtmlWebpackPlugin
already has a default template that it creates, but this just defines a custom one with that viewport option, right?
What was the problem we were having with the viewport tag missing here? The user will only see this (blank white) template for a split second before the real responsive or desktop app loads.
@andrewjensen Correct, the default template for HtmlWebpackPlugin
doesn't include a viewport definition and doesn't look like it provides a way to define one in its config.
We need to viewport tag there so that accurate screen sizes are reported. Safari will report in dips instead of px if it is not declared, so switcher.js does not match the correct screen size. We were noticing that it was matching desktop on iPhone
@bmbarker90 right, but the whole job of switcher.js and its template is to decide which page to redirect to. So why do we need to add the viewport to switcher's template? Is it because the incorrect viewport size persists even after the blank page redirects to the app?
@andrewjensen if we don't have the correct viewport size, enquire.js
will match the wrong ruleset. So for example in the current state of things, switcher.js redirects to desktop on iPhone instead of responsive like it should.
+1
include template for switcher's index.html to include a viewport meta tag. The viewport meta tag is
needed for enquire.js to properly work and switch to the correct project