From 3093b0cf61039b1d8882b469371f7781fa6499ca Mon Sep 17 00:00:00 2001 From: Eric Edem Date: Mon, 5 Nov 2018 17:37:04 -0800 Subject: [PATCH] fix: support mobile devices in examples (#2380) This change adds the standard meta tag for supporting mobile devices. Now when viewing on mobile the viewport width will adapt to the device. https://developer.mozilla.org/en-US/docs/Mozilla/Mobile/Viewport_meta_tag#Viewport_basics --- support/webpack/config.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/support/webpack/config.js b/support/webpack/config.js index 564663041..eb7623a28 100644 --- a/support/webpack/config.js +++ b/support/webpack/config.js @@ -68,6 +68,16 @@ const config = { title: 'Slate', template: HtmlWebpackTemplate, inject: false, + // Note: this is not the correct format meta for HtmlWebpackPlugin, which + // accepts a single object of key=name and value=content. We need to + // format it this way for HtmlWebpackTemplate which expects an array of + // objects instead. + meta: [ + { + name: 'viewport', + content: 'width=device-width, initial-scale=1', + }, + ], scripts: ['https://cdn.polyfill.io/v2/polyfill.min.js'], links: [ 'https://fonts.googleapis.com/css?family=Roboto:400,400i,700,700i&subset=latin-ext',